GEORGE SCOTT 619-792-7153
  • HOME
  • Adwords Q&A
  • Work Diary
    • 2020-21 Work
    • 2018-19 Work
    • 2016-17 Work
    • 2013-14 Work
  • WEBSITES
  • HUMOR

Creating a pdf of a webpage in asp classic

11/24/2018

0 Comments

 

dim theData
dim objDoc

Set theDoc = Server.CreateObject("ABCpdf10.Doc")
Set theDoc2 = Server.CreateObject("ABCpdf10.Doc")

theDoc.HtmlOptions.BrowserWidth = 1300
  
' apply a rotation transform
w = theDoc.MediaBox.Width
h = theDoc.MediaBox.Height
l = theDoc.MediaBox.Left
b = theDoc.MediaBox.Bottom 
theDoc.Transform.Rotate 90, l, b
theDoc.Transform.Translate w, 0

' rotate our rectangle
theDoc.Rect.Width = h
theDoc.Rect.Height = w 

'theDoc.Rect.Inset 72, 144
theDoc.HtmlOptions.UseScript = true
theDoc.HtmlOptions.AddLinks = true
theDoc.HtmlOptions.DoMarkup = true
theDoc.SetInfo 0, "CheckBgImages", "1"


theID = theDoc.AddImageURL(webPageURL)

Do
theDoc.FrameRect
If Not theDoc.Chainable(theID) Then Exit Do
theDoc.Page = theDoc.AddPage()
theID = theDoc.AddImageToChain(theID)
Loop

For i = 1 To theDoc.PageCount
theDoc.PageNumber = i
theDoc.Flatten
Next

'theDoc.Append(theDoc2) ' can add text to the top of the document, advertising, etc
theDoc.Save(Server.MapPath("/pdfs/" & strPDFname & ".pdf"))

thedoc.clear
thedoc2.clear

set thedoc = nothing
set thedoc2 = nothing
set thedata = nothing
0 Comments

    Archives

    October 2019
    July 2019
    May 2019
    April 2019
    November 2018
    August 2018
    June 2018

San Diego Easy Traffic School | San Diego Small Business Insurance | Traffic School Online | Finish Traffic School Today | Los Angeles Traffic School
  • HOME
  • Adwords Q&A
  • Work Diary
    • 2020-21 Work
    • 2018-19 Work
    • 2016-17 Work
    • 2013-14 Work
  • WEBSITES
  • HUMOR