0

I am trying to convert a Excel document to PDF. The Excel document has 64 pixels width for first 10 columns. I am using the A4 Sheet size for PDF in which the first 10 columns should fit. But, Excel only fits 9 columns. In this document right and left margin set to 0.7 inches. It uses the Arial font and size 10.

Expected :

Portrait Orientation

System Resolution : 1360 x 768

Available Sheet Size after subtracting margin = (8.27 - 1.4) x 96 = 659.52 pixels

First 10 columns with 64 pixels width = 64 x 10 = 640 pixels

640 pixels can be fit into 659.52 pixels PDF page.

Result

Only columns from 1 to 9 is fit into the first page of PDF.

What is logic or behavior of Excel for converting the document to PDF. What kind of scaling it uses?

Download the Excel document here

MOHAN C
  • 34
  • 4

1 Answers1

0

If you start from a Excel template file you can already set the "print range" to your 9 columns.

If you then convert it to PDF it will show like you want it to.

To save as PDF you can use the following

ExportAsFixedFormat(XlFixedFormatType.xlTypePDF)
Joeri E
  • 111
  • 9