Support Center » Knowledgebase » Programming and Scripting » ABCPDF 5 on Windows 2008

ABCPDF 5 on Windows 2008



On Windows 2008, ABCPDF version 5 (abcpdf5.doc) code wouldn't work if you added the content-length code from the example. Simply comment out the following line:

'Response.AddHeader "content-length", UBound(theData) - LBound(theData) + 1

Here is a full example that will work:

<%
theID = 0
thePad = 10
theText = "Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur. Hi omnes..." ' truncated for clarity
Set theDoc = Server.CreateObject("ABCpdf5.Doc")
theDoc.Width = 4
theDoc.FontSize = 32
theDoc.TextStyle.Justification = 1
theDoc.Rect.Inset 20, 20

theDoc.FrameRect
theID = theDoc.AddHtml(theText)
While theDoc.Chainable(theID)
  theDoc.Page = theDoc.AddPage()
  theDoc.FrameRect
  theID = theDoc.AddHtml("", theID)
Wend
theData = theDoc.GetData()
Response.ContentType = "application/pdf"
'Response.AddHeader "content-length", UBound(theData) - LBound(theData) + 1
Response.Addheader "content-disposition", "inline; filename=MyPDF.PDF"
Response.BinaryWrite theData
%>


Article Details
Article ID: 213
Created On: 26 Jul 2014 01:14 AM
 Back
 Login [Lost Password] 
Email:
Password:
Remember Me:
Please note that the login and password to the support area is NOT the same as your hosting control panel login and password
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Downloads | Control Panel User's Guide | Server Status
Language: