Please give a brief summary of your issue:
The orientation of vertical freetext annotations are being changed to horizontal on merging xfdf and pdf files.
Please describe your issue and provide steps to reproduce it:
For comments added vertically, the orientation is correct when viewed in webviewer:
but when we save the file , the orientation of freetext annotation is changed as shown:
We are saving the pdfDocument as shown:
using (var pdfDocument = new PDFDoc(pdfFileStream))
{
var xfdfString = new StreamReader(xfdfFileStream).ReadToEnd();
using (var fdfDoc = new FDFDoc(FDFDoc.CreateFromXFDF(xfdfString)))
{
pdfDocument.FDFUpdate(fdfDoc);
}
pdfDocument.RefreshFieldAppearances();
pdfDocument.RefreshAnnotAppearances();
pdfDocument.Save(pdfFileStream, pdftron.SDF.SDFDoc.SaveOptions.e_linearized);
}
What is causing the orientation change and what should I do to have correct orientations for annotations during save?
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It seems like the orientation of free text annotations is being altered during the save operation, which could be due to how the annotations are being refreshed or updated in the PDF document. Free text annotations can have orientation issues if their appearance is not correctly set before saving.
Some things you can try:
Ensure that the annotation appearance is correctly set before refreshing by explicitly setting the necessary properties for the annotation.
Use the pdfDocument.RefreshAnnotAppearances() method carefully to ensure it does not override the intended orientation settings.
Check if the XFDF data contains any transformation matrix that might be affecting the orientation and adjust it accordingly.
After updating the FDF, iterate over the annotations to manually set their orientation if necessary.
Thank you for contacting us about this. Can you please provide us with the original PDF and XFDF input that you are merging that showcases this issue?
If you would not like to attach it to this public forum post, please send an email to support@apryse.com or open a ticket via our portal at support.apryse.com. Please reference this forum post in your ticket/email.