Closed AMcPherran closed 4 years ago
Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/
@AMcPherran We are looking at this. Can you provide similar PDFs with other fields, such as combo boxes, checkboxes too? A mix of fields including text fields, would be great so we can test those properly.
Here is a document I created with more field types that is rotated
@gunnsth I tested out the PDF provided by @tmlbl with v3.8.0
and found that Text fields are all properly rotated now, but the other field types (like the checkbox) are not. I haven't tested the image fields, dropdowns, or radio buttons yet
FilledFieldTypesRotated.pdf
@AMcPherran Did you use the standard example with field appearance set as:
fieldAppearance := annotator.FieldAppearance{OnlyIfMissing: true, RegenerateTextFields: true}
Typically correct appearances are already available in forms for static fields such as checkboxes, dropdowns, radio buttons.
I generated the appearance with those default options (as per the example) and in that case the appearance was correct. out.pdf
Note that text is most important to regenerate since it is most dynamic. The form creators such as Adobe create desired appearances for all display options for fields with finite number of states (e.g. checkbox: appearance, unchecked appearance).
In your output PDF it seems like the tick mark looks a bit different. Did you customize it? That would force appearance regeneration (in which the problem is with the appearance generation). By setting OnlyIfMissing: false
we can identify more issues with appearance generation as it forces appearance generation of each field, instead of relying on the appearance generation already provided by the form creator for each state.
Description
When UniPDF is used to fill the AcroForm on a PDF which has been rotated, the values filled into the fields do not conform to the page's rotation.
Expected Behavior
The values filled into a rotated PDF form are rotated to match the orientation of the fields.
Actual Behavior
Steps to reproduce the behavior:
pdf_form_fill_json
example code ready to run (link )90Degrees.pdf
and90Degrees.json
files, and place them in yourunipdf-examples/forms
directory.go run pdf_form_fill_json.go 90Degrees.pdf 90Degrees.json Filled90Degrees.pdf
to fill the form.Filled90Degrees.pdf
, and observe that the text filled into the field does not match the rotation of the page, and may even appear cut off.270Degrees.pdf
+270Degrees.json
Attachments
90Degrees.pdf 90Degrees.json:
270Degrees.pdf 270Degrees.json: