Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF file should be landscape...

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
US
...but it is portrait!

I am using the PrintDocument object to generate reports in my desktop application written in vb.net and C# using VS 2017. If I choose an actual printer from the print dialog the resulting output is in landscape since I set the page settings that way.

However, if I choose "Microsoft Print to PDF", the resulting PDF file comes up as Portrait when I go to print it later. Changing it to Landscape at that time, results in a properly oriented report.

So, my question is, how do you transfer the PDF's desired orientation into the actual PDF file that is created programmatically?

I have provided a PDF document with some screenshots of my code and the resulting output. Maybe someone can see what I am doing wrong.

Thanks in advance,
Jerry

Jerry Scannell
 
 https://files.engineering.com/getfile.aspx?folder=4e047676-558c-48d2-b6ad-0897b81dfab2&file=Report_generation.pdf
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top