Saves a document to memory.

 

   
Syntax
 
     

Data = Doc.GetData()

 

   
Params
 
     
Name   Type   Description
Data Array of Bytes

The PDF document as an Array of Bytes.

 

   
Notes
 
     

Normally you will want to save your documents using the Save method. However sometimes you will need to obtain your PDF as raw data rather than in file format. The GetData method allows you to do this

You may wish to write a PDF direct to a client browser rather than going through an intermediate file. The data you obtain using GetData can be written direct to an HTTP stream using Response.BinaryWrite. Similarly you may wish to obtain raw data for insertion into a database.

 

   
Example
 
     

The following code illustrates how one might add text to a PDF and then write it direct to the client browser. This code is an entire Active Server Page - hello.asp.

<% @Language="VBScript" EnableSessionState=FALSE %>

<%
Set theDoc = Server.CreateObject("ABCpdf3.Doc")
theDoc.FontSize = 96
theDoc.AddText "Hello World"
Response.ContentType = "application/pdf"
Response.AddHeader "content-disposition", "inline; filename=MyPDF.PDF"
Response.BinaryWrite theDoc.GetData()
%>


hello.asp

 

   

 

Browser Based Help. Published by chm2web software.