How to fit in each excel in one Page of PDF

Hi All,

I have a scenario to convert excel to PDF , while I do that I need each sheet to fit in one page but instead one sheet splits in to 2 page in PDF? any idea how I can fit one page in PDF.

1 Like

Hi ,

Is your Data is too large for one page ?

If not try by adjusting the row height and also reduce font size.

@monishanair2010

Please check this…you can use this in invoke code

https://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Document-Operation/How-to-Print-Excel-Files-in-C-VB.NET.html

Cheers

How to export Excel as PDF as one page?
Head to File > Page setup…
Under “Scaling”, select the “Fit to” option.
Add “1” to “Pages in width” and “1” to “Tall”.
Click “Ok”. …
Now head to File > Save As.
Select “PDF” for your format and adjust the other settings to your preferences.
Click “Save”.

Regards,
Will

1 Like

@Anil_G - if we need to use this code, do we need to install Spire packages right ?

@monishanair2010

For that yes we need it…elae we can try with this where we can still change the properties

https://answers.microsoft.com/en-us/msoffice/forum/all/vba-to-save-excel-files-as-pdf/889f69f2-72ce-43cd-8911-71f3b6c3a7cc

Cheers

Just because this topic is getting some views and yet the way to do this with Studio was still missing, I prepared this small sample process:
PrintExcelFileIntoPDF.zip (93.0 KB)

I will admit that the VBS script itself was mostly created with Chat GPT, but I fine tuned it a bit to take in some arguments to display their usage as well as to cover the main use case.

The configuration looks like this:

It converts the following Excel file sheet:

Into the following PDF:

If you found it useful, please give it a like :slight_smile: :+1:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.