Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Dec 09, 2021 11:29 am

Hello,

After upgrading Spire library version from 5.6 to 7.11, alignment of some fields are changed in PDF printout.

We have PDF form file, we set its field from our code and then print it.
PDF prints with both version is attached as PDFPrints.zip for comparisons.
Code.zip is visual studio project for reference purpose.
KVFMuster4_2020.zip in PDF form file which contains configured textboxfields.

Please have a look at the issue.

Thanks,
Jignesh Rathod

jigratho
 
Posts: 13
Joined: Thu Feb 14, 2019 8:32 am

Fri Dec 10, 2021 3:02 am

Hello,

Thank you for your inquiry.
I tested your case and did reproduce your issue. I have logged the issue into our bug tracking system with the ticket number SPIREPDF-4833. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Jan 05, 2022 9:26 am

Hello,

Thanks for your patience.
After investigation, we found that the form field of your source PDF file covers part of the text and the text in the form field is displayed vertically and centered, so the result file printed by the latest version of Spire.PDF is correct. If you use Adobe to fill in the text, you will find that the result file is the same as the result file generated using the latest version of Spire.PDF. To prevent the text from being obscured, I suggest you move the form field down or reduce the height of the form field when creating a PDF file.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Jan 05, 2022 10:15 am

Hello,

Thanks for reply.
Currently we have hundreds of Pdf form files which is working properly with Spire pdf version 5.6.
Alignments are perfect when printed with older version of spire pdf library.
What is changed in between version 5.6 and latest version?
Moving the fields and reducing their heights will be too much change for hundreds of pdf files and fields in them.
We need a way to use the old alignment with latest spire.pdf version.

Thanks,
Jignesh

jigratho
 
Posts: 13
Joined: Thu Feb 14, 2019 8:32 am

Thu Jan 06, 2022 6:54 am

Hello,

Thank you for your feedback.
1) Compared with version 5.6, the latest version of Spire.PDF contains more fixes and new features, and optimized algorithms. It is more comprehensive in terms of function and better in terms of performance.
2) After investigation, we found that we can achieve your desired result by setting the height of the text box field. We suggest you try this method. The reference code is as follows.
Code: Select all
...
case PdfTextBoxFieldWidget textBoxField:
    if (value != null)
    {
        //Get the width of the text box field
        float widths = textBoxField.Size.Width;
        //Set the height of the text box field
        textBoxField.Size = new SizeF(widths,20);
        textBoxField.Text = value;
    }                       
    else
        textBoxField.Text = fieldName;
...

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron