DynamicPDF™ Generator for COM/ActiveX can output PDF documents to a file,byte Array and IIS Stream object that supports writing. The Draw , DrawToFile and DrawToWeb methods of the Document class handle all document output. These methods manages output of the PDF document.
Output to an ASP page (WebForm)
[ASP - VBScript]
<!--METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
' Outputs the PDF document to the page object.
Dim MyDocument
Dim MyPage
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
Set MyPage = MyDocument.AddPage()
MyPage.AddBackgroundImage Server.MapPath( "Images/DPDFLogo_TM.png" )
MyDocument.DrawToWeb True 'Caching is needed
Set MyPage = Nothing
Set MyDocument = Nothing
%>
Output to a file
Specify the file path and name for the file in the Documents DrawToFile method.DrawToFile does not work in ASP.
[VBScript]
' Outputs the PDF document to a file.
MyDocument.DrawToFile("MyDocument.pdf" )
Output to a byte array
When calling the Draw method with no parameters, it will return the PDF data as a Variant. This is useful when storing the PDF in a database.
[VBScript]
' Outputs the PDF document to a byte array.
Dim MyData
MyData = MyDocument.Draw()
| See Also |
Document Class | Document.Draw Method | Document.DrawToWeb Method | Programming with Generator for COM/ActiveX

