We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert XFA to AcroForm using Aspose.PDF for .NET - Layout is messed up in output

Hello,
I have a few PDF templates. I import XML data to the PDF templates and then convert it to static type. The result is as expected.
At the end, I want to merge these multiple PDFs to be one file. I tried both Concatenate and page.add(), the result only contain the first PDF file. I tried to convert all these documents to Standard type. The PDFs files got merged, but the layout got messed up.
I have one sample PDF file attached. It is Static type. If I convert it to Standard type, I got following issues.

  1. The blue table header got repeated on the second page.
  2. Table rows do not auto grow when there is more data in the field.
  3. The image (the red OK image) in the signature disappeared.
    Is there a solution form.pdf (1.5 MB)
    to resolve these issues?

@tjwk

Thank you for contacting support.

We have investigated the file shared by you and have been able to notice the problems when PDF file is viewed in browser, like Google Chrome. Whereas, the file appears fine when opened with Adobe Reader as in attached screenshots. Since browsers are not reliable PDF viewers and Adobe being at the center of everything connected to PDF, is a better option to use for viewing PDF files.

Adobe Reader.PNG
Chrome.PNG

I was not using browser to view the file. The previously attached file is the XFA format which looks fine. The issue is after converting it to Standard type AcroForm, the layout is wrong in Adobe Reader. Here is the AcroForm pdf file. AcroForm.pdf (1.5 MB)
You can compare it to the previous file I attached to see the differences.

@tjwk

Thank you for elaborating it further.

We have been able to reproduce the problem with below code snippet in our environment. A ticket with ID PDFNET-46180 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

    var pdfDocument = new Aspose.Pdf.Document(dataDir + "form.pdf");
    pdfDocument.Form.Type = FormType.Standard;
    pdfDocument.Save(dataDir + "form_standard.pdf");

We are sorry for the inconvenience.

Thanks for investigating this issue.
Is there a walk around solution for this? If you can tell me how to resolve the issue by changing my PDF template, I am happy to make that change as well.

@tjwk

We are afraid there may not be any workaround available for this problem. We will update you as soon as any further update will be available in this regard.