Converting excel worksheet to pdf crops text

Hi,
I’m trying to convert an excel workbook to PDF and it crops part of my text when doing so.
Is there a setting that I’m missing. I’ve been using
OutputWB.Save(PDFName, SaveFormat.Pdf); to convert my excel workbook to PDF.

@JThomas98
Please provide us the template file so we can check and figure the issue out for you.

Here’s the template, the output and its pdf:
test.zip (156.5 KB)

@JThomas98 ,

I have evaluated your issue using your template files. I noticed that there is a printable area set for the worksheet. Could you please clear the printable area before rendering to PDF? This may work for your needs and prevent any text from being cropped.

OutputWB.Worksheets[0].PageSetup.PrintArea = "";

Let us know if you still find any issue.

@amjad.sahi,
Thank you for pointing out the print area in my workbook. This has rectified the issue for me. The text no longer gets cropped. But I’m seeing another issue with it. Once I clear the print area, the pdf does not occupy the entire page any more. Is there something that I could do to fit the worksheet to fill the entire page while converting it to PDF?

@JThomas98,

Good to know that text cropping text is gone by removing the printable area.

I think to fit whole sheet in one page, you may set OnePagePerSheet option, see the document for your reference.

@amjad.sahi,
This is great! Thanks again!

@JThomas98,

You are welcome.