Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon May 02, 2016 9:33 am

Hi,

We have a problem XLSX export to PDF.
We need to insert a logo in the page header. And we need to export the document to PDF format.
But in the PDF document there is a problem. Logo is very stretched, it does not fit, and spoils the page and the rest of the PDF document.
There is another problem. This defect is not repeated on any PC. We have in the organization on the same PC it works fine, but in my - bad.
Unfortunately we could not find out, which is why there is such behavior, so we can not fix.

I am attaching the file, it is a simple example, and the same files, the results in Excel and PDF formats.
There's Resources folder, there are two image logo. The google logo, and the logo, which we need to be inserted into the header of the document.
If you insert them separately, that is to make only one page in the document and to insert only the logo Google, you do not have problems. If you put our logo - it is inserted bad.
If you make two pages (as in the example), put the Google logo on the first page and put our logo on the second page, the Google logo disappears. Although Excel document it is. Our logo is stretched to the entire page.
On the PC, where everything works well - both the logo is in the document.

There is one more thing that I noticed.
If you take our picture logo (Resources\logo10.jpg), to change the height from 117 to 100, and make export to PDF, the logo is inserted more or less OK, but not perfect. Logo Google is still present.

If export Excel to PDF in Microsoft Excel, the exports did well.
Attachments
TestPdfHeader.zip
(521.79 KiB) Downloaded 446 times

bloodmozg
 
Posts: 15
Joined: Thu Apr 23, 2015 12:37 pm

Tue May 03, 2016 7:19 am

Hello,

Thanks for your kind feedback and your files.
I have noticed this issue that the logo on the first page disappears when inserting two logos to two pages, and forwarded it to our dev team. Regarding the issue that your logo (Resources\logo10.jpg) is stretched when inserting it to one page in the document, we can not reproduce it. Please try the latest version Spire.XLS Pack Hotfix Version:7.9.43.
Also, I tested your two files (res_image_normal.xlsx and res_image_height_less.xlsx) and noticed your issues that the logo on the first page disappears and your picture logo on the second page is stretched when converting the file (res_image_normal.xlsx) to pdf. I have forwarded them to our dev team. Sorry for the inconvenience that the issues brought for you. We will inform you once it is resolved.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Tue Jun 28, 2016 4:03 am

Hi,

Thanks for your waiting.
Your issue has been basically fixed and now there is only a little issue that the text and image overlap as the below screenshot showed. We will continue fixing the remainding issue, and inform you when it is fixed.
issue.png
issue.png (129.19 KiB) Viewed 5694 times

Now, please download new version, Spire.XLS Pack Hotfix Version:7.10.24 to test fixed issues.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Wed Jul 27, 2016 4:56 pm

Hi,

We have updated Spire.XLS version, and check your fixes. Logo in the header is really fixed, everything is ok!
But there is the same problem in a footer. Symptoms of the problem about the same, but I will make an archive with the same examples.
Attachments
TestPdfFooter.rar
(529.4 KiB) Downloaded 477 times

bloodmozg
 
Posts: 15
Joined: Thu Apr 23, 2015 12:37 pm

Thu Jul 28, 2016 5:59 am

Hi,

Thanks for your feedback.
I have tested your project with the Spire.XLS V7.10.24, but didn't notice the issue you mentioned, I have attached the result PDF, please check and make sure if you use this version.

Sincerely,
Betsy
E-iceblue support team
Attachments
res.zip
(47.15 KiB) Downloaded 415 times
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Wed Jun 23, 2021 8:36 am

I want to create pdf from excel but it converts half into pdf and on one page only. please help me this

aveesibal
 
Posts: 1
Joined: Wed Jun 23, 2021 8:29 am

Wed Jun 23, 2021 9:55 am

Hello,

Thank you for your inquiry.
Please refer to the following code to fit content to one page. If this doesn't help, please provide your sample excel file and your expected output file for further investigation. You could attach them here or send to us via email (support@e-iceblue.com). Thanks in advance.
Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile(sampleFile);

            foreach (Worksheet sheet in workbook.Worksheets)
            {
                sheet.PageSetup.FitToPagesWide = 1;
                sheet.PageSetup.FitToPagesTall = 1;
            }
            workbook.SaveToFile(resultFile, FileFormat.PDF);

Sincerely,
Annika
E-iceblue support team
User avatar

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

Fri Jul 02, 2021 7:07 am

Hello,

Greetings from e-iceblue.
How is your issue going? Has it been resolved? If not, please provide your sample excel file and your expected output file for further investigation. You could attach them here or send to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

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

Return to Spire.XLS

cron