Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.11 KB | None | 0 0
  1. /**
  2.      * Generating the PDF
  3.      */
  4.     var theDoc = Server.CreateObject("ABCpdf5.Doc");
  5.     theDoc.MediaBox="A4";
  6.     theDoc.Rect = "A4";    
  7.     var ladate, theID;
  8.    
  9.     ladate = Date();
  10.    
  11.     var RS8, fileName8;
  12.     RS8 = Server.CreateObject("ADODB.Recordset");
  13.     fileName8 = "Select * from Invoice where InvoiceUserID = '"+ originalMaster + "' and UserInvoiceStep = 3";
  14.     RS8.Open(fileName8, Con);
  15.    
  16.     theDoc.Rect.Inset (20,20);
  17.     theDoc.HtmlOptions.PageCacheEnabled=false ;
  18.     theDoc.HtmlOptions.PageCacheClear();
  19.     theDoc.Page = theDoc.AddPage();
  20.    
  21.     var theURL = "";
  22.     theURL = "http://barcodeconf.onetec.be/AEIRD/invoiceLine.asp?reference=" + RS3("UserOrder").Value + "";
  23.      
  24.     theID = theDoc.AddImageUrl(theURL);
  25.    
  26.     while(theDoc.Chainable(theID)){
  27.         theDoc.Rect.Inset(20,20);
  28.         if(theDoc.Chainable(theID)){
  29.             theDoc.Page = theDoc.AddPage()
  30.             theID = theDoc.AddImageToChain(theID)
  31.         }
  32.     }
  33.    
  34.     var i;
  35.    
  36.     for(i = 1; i < theDoc.PageCount; i++){
  37.       theDoc.PageNumber = i;
  38.       theDoc.Flatten;
  39.     }
  40.    
  41.     theDoc.Save("d:\\Sites\\Invoice\\AEIRD_Stockholm\\invoices\\i" + RS8("InvoiceID").Value + ".pdf");
  42.     theDoc.Clear();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement