Change Page Orientation

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for COM/ActiveX (v4)  /  Change Page Orientation

DynamicPDF Generator for COM/ActiveX (v4) Forum

 Jul 11 2009 11:28 PM
How do I change a page to landscape orientation in asp?
 Jul 13 2009 4:54 AM
Posted by a ceTe Software moderator
Hello,

In order to create a page in landscape mode you will have to swap the width and height of the page. You can refer to the Coordinate System topic on our help documentation.

Thanks,
ceTe Software Support Team
 Jul 13 2009 6:04 AM
Thank you very much.  That worked perfect.
 Aug 20 2020 12:07 PM
I can't seem to figure this out. I want to change a page to landscape,  When I use SetMargins , nothing changes.  Can you give me an example in classic ASP  for changing a page to landscape?  Thank you.
--Jim
 Aug 20 2020 1:25 PM
Posted by a ceTe Software moderator
Hello Jim,

You can set the width and height to the Page object using PageWidth and PageHeight properties.  Below is a code sample:

<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
               'The METADATA tag above was added to import the constants (i.e. DPDF_Font_Helvetica).
               Option Explicit
               Dim MyDocument, MyPage
               Dim MyStrText
               ' Create Document object and set properties
               Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
               ' Add a page to the document
               Set MyPage = MyDocument.AddPage()
               MyPage.PageWidth=11*72
               MyPage.PageHeight=8.5*72
               ' Add a textarea to the page
               MyStrText = "Hello ASP World..." & vbCrLf & "From DynamicPDF Generator for COM/ActiveX" & vbCrLf & "DynamicPDF.com"
               Dim MyLabel
                Set MyLabel = MyPage.AddLabel(MyStrText, 0, 0, 504, 54)
               ' Output the Document to the Browser
               MyDocument.DrawToWeb
               ' Object cleanup
               Set MyPage = Nothing
               Set MyDocument = Nothing
%>

Thanks,
ceTe Software Support Team


All times are US Eastern Standard time. The time now is 7:19 AM.