Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Report not printing in landscape
posted

Hi

The following code is not printing my PDF document in landscape.  Can you have a look at it please.  I'm using Windows Forms Version 20092.1003

Are there any known issues?

Thanks,

Dave

Dim myimage As Image = Bitmap.FromFile("C:\Users\myuser\AppData\Local\Temp\201121541286.jpg")

 

 

 

 

 

 

 

 

Dim report As Infragistics.Documents.Report.Report

report =

New Report()

report.Preferences.Printing.PaperSize = Infragistics.Documents.Report.Preferences.Printing.PaperSize.A4

report.Preferences.Printing.PaperOrientation = Infragistics.Documents.Report.Preferences.Printing.PaperOrientation.Landscape

report.Preferences.Printing.FitToMargins =

True

 

 

Dim section1 As Infragistics.Documents.Report.Section.ISection = report.AddSection

section1.PageOrientation = Infragistics.Documents.Report.Preferences.Printing.PaperOrientation.Landscape

section1.AddQuickImage(

New Infragistics.Documents.Graphics.Image(myimage)).Stretch = True

section1.PageMargins.All = 50

report.Publish(

"C:\TestPDF.pdf", Infragistics.Documents.Report.FileFormat.PDF)

 

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    I did a little research and it looks like all of the Preferences.Printing and section.PageXXX properties only apply to the report.Print method. They have no effect on the document itself.

    A PDF document doesn't have any concept of page orientation - this is only determined during a print operation.

    So I think what you would have to do is set the size of the page and reverse the width and height. For example:

    section1.PageSize = New PageSize(Infragistics.Documents.Report.PageSizes.A4.Height, Infragistics.Documents.Report.PageSizes.A4.Width)

Children