You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
/CO: Array
/DA: /QuickPDFF6af2e376 0 Tf 0 0 0 rg
/DR: Dictionary
/Encoding: Dictionary
/Font: Dictionary
/Helv: 88 0 R
/QuickPDFF6af2e376: 158 0 R
/ZaDb: 89 0 R
With a form field as shown below
/DA: /QuickPDFF6af2e376 11 Tf 0 0 0 rg
/F: 4
/FT: /Tx
/Ff: 8388608
/P: 95 0 R
/Q: 0
/Rect: Array
/Subtype: /Widget
/T: F4260
/TU:
/Type: /Annot
/V:
I would like to add value to this form field (with appropriate appearance dictionary)
I followed this reference (https://corymickelson.github.io/NoPoDoFo/documentation/cookbook/ap.html) for adding appearance stream
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
getFont(name: string): Font
listFonts(): { id: string, name: string }[]
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
The text was updated successfully, but these errors were encountered:
Thank you @panneer the form class has an accessor to the dictionary resource via
constdr=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
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
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
The text was updated successfully, but these errors were encountered: