<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Debenu Quick PDF Library - PDF SDK Community Forum : Page backgrounds</title>
  <link>http://www.quickpdf.org/forum/</link>
  <description><![CDATA[This is an XML content feed of; Debenu Quick PDF Library - PDF SDK Community Forum : I need help - I can help : Page backgrounds]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 19 May 2026 04:27:54 +0000</pubDate>
  <lastBuildDate>Tue, 20 Jun 2006 16:02:07 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.01</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.quickpdf.org/forum/RSS_post_feed.asp?TID=443</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Debenu Quick PDF Library - PDF SDK Community Forum]]></title>
   <url>http://www.quickpdf.org/forum/forum_images/QPDF_Forum_Title.png</url>
   <link>http://www.quickpdf.org/forum/</link>
  </image>
  <item>
   <title><![CDATA[Page backgrounds : chicks, this approach worked...]]></title>
   <link>http://www.quickpdf.org/forum/page-backgrounds_topic443_post1990.html#1990</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=219">StanMarshall</a><br /><strong>Subject:</strong> 443<br /><strong>Posted:</strong> 20 Jun 06 at 4:02PM<br /><br /><P>chicks,</P><P>this approach worked wonderfully.</P><P>thanks a lot!!</P><P>stan</P>]]>
   </description>
   <pubDate>Tue, 20 Jun 2006 16:02:07 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-backgrounds_topic443_post1990.html#1990</guid>
  </item> 
  <item>
   <title><![CDATA[Page backgrounds : Here&amp;#039;s an example (vbscript)...]]></title>
   <link>http://www.quickpdf.org/forum/page-backgrounds_topic443_post1960.html#1960</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=115">chicks</a><br /><strong>Subject:</strong> 443<br /><strong>Posted:</strong> 16 Jun 06 at 6:18PM<br /><br />Here's an example (vbscript) that reads a .txt file from a mainframe (with pagebreaks every nn lines), writes each page to a new PDF page, and stamps a letterhead graphic from another PDF file on each page.<br /><br />Option Explicit<br /><br />Const ForReading = 1<br />Const ForWriting = 2<br />Const Portrait&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Letter"<br />Const Landscape  = "Letter Landscape"<br /><br />Dim QP, QuickPDFKey, srcFileName, destFileName, fso, src, lne, text, page, textSize<br />Dim fontID, docID<br />Dim templateFileName<br />Dim lines, maxLen<br /><br />'-- Init iSedQuickPDF and FSO objects<br />Set QP = CreateObject("iSED.QuickPDF")<br />Set fso = CreateObject("Scripting.FileSystemObject")<br /><br />'-- Set file names<br />QuickPDFKey&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= WScript.Arguments(0)  <br />srcFileName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= WScript.Arguments(1)  '-- Text file to convert to PDF<br />destFileName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= WScript.Arguments(2)  '-- Output PDF filename<br />templateFileName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = WScript.Arguments(3)  '-- Letterhead PDF template filename<br /><br />'-- Unlock the PDF library<br />Call QP.UnlockKey(QuickPDFKey)<br /><br />'-- Open the text file for reading<br />Set src = fso.OpenTextFile(srcFileName, ForReading)<br /><br />page&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br />lines&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br />maxLen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br />fontID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 0<br /><br />'-- Load PDF Template<br />docID = LoadTemplate(templateFileName)<br /><br />Do Until src.AtEndOfStream<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Read a line from text file<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lne = src.ReadLine & VbCr<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- If pagebreak is found<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Left(lne,1) = Chr(12) Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Write text to the template<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WritePage<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = Mid(lne, 2)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lines = 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxLen = 0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Add the line to buffer<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = text & lne<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lines = lines + 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Len(lne) &gt; maxLen Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxLen = Len(lne)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br />Loop<br /><br />'-- Write final page<br />WritePage<br /><br />'-- Compress the file size<br />Call QP.CompressContent()<br /><br />'-- Write to PDF file<br />Call QP.SaveToFile(destFileName)<br /><br />Set fso = Nothing<br />Set src = Nothing<br />Set QP  = Nothing<br /><br />'-- Write the text to PDF page<br />'-- Use simple logic to set text and page size<br />Sub WritePage<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Increment page counter<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page = page + 1<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Create new PDF page<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If page &gt; 1 Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.NewPage()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Set origin to top left corner<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SetOrigin(1)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Select current page<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SelectPage(page)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Set to portrait or landscape<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If maxLen &gt; 100 Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SetPageSize(Landscape)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SetPageSize(Portrait)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Draw the template onto current page<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.DrawCapturedPage(docID, 0, 0, QP.PageWidth(), QP.PageHeight())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Select Courier (fixed) font<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If fontID = 0 Then <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fontID = QP.AddStandardFont(0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SelectFont(fontID)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Set text size<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If maxLen &gt; 100 Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textSize = 8<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElseIf lines &gt; 80 Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textSize = 7<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ElseIf lines &gt; 66 Or maxLen &gt; 81 Then <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textSize = 8<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textSize = 10<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SetTextSize(textSize)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Print info<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo "Page:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & page<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo "Lines:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & lines<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo "Max Line Length:  " & maxLen<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo "Text Size:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " & textSize<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo ""<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'-- Draw report text onto template<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.DrawMultiLineText(72, 108, VbCr, text)<br /><br />End Sub<br /><br />'-- Load template PDF, capture first page, and return its ID<br />Function LoadTemplate(templateFileName)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If QP.LoadFromFile(templateFileName) = 0 Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo("Could Not Load PDF Template: " & templateFileName)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WScript.Quit(1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SetOrigin(1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.NewPage()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call QP.SelectPage(1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LoadTemplate = QP.CapturePage(1)<br />End Function<br />]]>
   </description>
   <pubDate>Fri, 16 Jun 2006 18:18:21 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-backgrounds_topic443_post1960.html#1960</guid>
  </item> 
  <item>
   <title><![CDATA[Page backgrounds : thanks chicks!! i&amp;#039;ll give...]]></title>
   <link>http://www.quickpdf.org/forum/page-backgrounds_topic443_post1959.html#1959</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=219">StanMarshall</a><br /><strong>Subject:</strong> 443<br /><strong>Posted:</strong> 16 Jun 06 at 5:16PM<br /><br /><P>thanks chicks!!</P><P>i'll give that approach a try.</P>]]>
   </description>
   <pubDate>Fri, 16 Jun 2006 17:16:55 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-backgrounds_topic443_post1959.html#1959</guid>
  </item> 
  <item>
   <title><![CDATA[Page backgrounds : You should append the &amp;#034;shell&amp;#034;...]]></title>
   <link>http://www.quickpdf.org/forum/page-backgrounds_topic443_post1958.html#1958</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=115">chicks</a><br /><strong>Subject:</strong> 443<br /><strong>Posted:</strong> 16 Jun 06 at 2:17PM<br /><br />You should append the "shell" to the end of a new PDF, capture it (which removes it from the document), then stamp it onto each new page using DrawCapturedPage().  No need for a hidden page.<br /><br />This also keeps the file size small, since the captured page is a PDF template, and is stored only once in the PDF.  For example, I have a PDF template with a letterhead graphic that is 19,630 bytes.  Stamped onto each page of a seven-page report using DrawCapturedPage(), and writing text to each page, the total output file size is just 26,947 bytes.]]>
   </description>
   <pubDate>Fri, 16 Jun 2006 14:17:58 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-backgrounds_topic443_post1958.html#1958</guid>
  </item> 
  <item>
   <title><![CDATA[Page backgrounds : Hi all... I have written (using...]]></title>
   <link>http://www.quickpdf.org/forum/page-backgrounds_topic443_post1957.html#1957</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=219">StanMarshall</a><br /><strong>Subject:</strong> 443<br /><strong>Posted:</strong> 15 Jun 06 at 4:24PM<br /><br /><P>Hi all...</P><P>I have written (using Delphi 5 and QuickPDF) an application that produces personalized reports for everyone in a supplied data file. I am also given a PDF file to use as the background or "shell" (like a "shell" in the world of offset printing) for the report. (The shell portion of the report is the same for everyone.)</P><P>The PDF file I end up producing contains many reports (one for each person in the datafeed).</P><P>Currently my application reads in the shell PDF file, adds it to the PDF file I create as a hidden page, and then clones it for each report. (This prevents me from having to include the shell PDF in the file multiple times...thus keeping the file size and RIPping time down.)</P><P>Then, for each individual in the datafeed,&nbsp;my application draws whatever&nbsp;personalized&nbsp;info is required&nbsp;we need to over the shell.</P><P>This has worked wonderfully up to now. It can be viewed in Acrobat and GSView. It has printed successfully on many printers. The pages are correctly identified as the number page they are (i.e., page 1 is shown as page 1). etc.</P><P>But now a printing company we are partnering with wants to print them via an automated tracking system they have in place. It pre-flights the files and reports that the PDFs are corrupt. They say that there is some "offset marker" that is incorrectly stating where "page 1" of the file starts in the print file data stream.</P><P>Through trial and error, we have come to suspect that the problem is with the hidden page that I am using for cloning. If you count the hidden page, then "page 1" of the file (which is shown as page 1 and correctly identified as page one by Acrobat) is really page 2.</P><P>Has anyone run into this issue? Have any suggestions for fixing it? Or another approach to using the same page background (loaded from an external PDF file) over and over without having to include it in the file multiple times?</P><P>Thanks.</P><P>Stan</P>]]>
   </description>
   <pubDate>Thu, 15 Jun 2006 16:24:31 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-backgrounds_topic443_post1957.html#1957</guid>
  </item> 
 </channel>
</rss>