Open panneer opened 4 years ago
Thank you @panneer the form class has an accessor to the dictionary resource via
const dr = form.DR
This returns a NoPoDoFo.Dictionary. Do you have an example of this not working for you? I understand the use case around getting fonts from this resource, I will look into this, but in the interim please try the DR
property of the Form class.
I initially tried form.DR accessor to get the info about the font details and it works. Thanks
Still for my requirement, I need to get the Acroform->DR defined font as NFont object, so that I can assign this font in painter instance when creating appearance stream for the value. For example, {code}font = form.getFont('Helv') ... const painter = new nopodofo.Painter(doc) ... painter.setPage(xobj) ... painter.font = font // font object fetched from Form.getFont() API painter.beginText({x: 2, y: 2}) ...{code}
Basic idea is to use the field DA defined font for the field values.
> Do you have an example of this not working for you? Yes, I have attached the sample program (with a PDF sample). Hope it helps you. Attachment: sample-program.zip
> I understand the use case around getting fonts from this resource, I will look into this Thank you so much
> but in the interim please try the DR property of the Form class. Meanwhile, I took the liberty to extend the nopodofo source for my requirement and do achieved my requirement to certain extent. Please check the changes I made and let me know your opinion. Attachment: form-font-access-changes.zip
Thanks a lot in advance and wish you nice day
Hey @corymickelson
I first thank you for your great work (nopodofo).
I need a feature to access the acroform defined resources (Acroform->DR). Could you tell me whether you have a plan for this feature in your road map and when I could expect it?
I could not share the PDF sample for privacy reasons.
My actual use case PDF is defined
With a Acroform dictionary as shown below
With a form field as shown below
When adding the appearance stream for field, I don't want to create a new font for field value. Instead, I wish to get 'QuickPDFF6af2e376' font from Acroform->DR. Like the font accessing APIs defined in Document object
I am not sure whether nopodofo already has functionality to achieve my requirement. Please give me some advise to meet my requirement
Thanks a lot in advance