<?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 : Damaged PDF generated (Chapter II)...</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 : Damaged PDF generated (Chapter II)...]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 00:18:25 +0000</pubDate>
  <lastBuildDate>Wed, 12 Dec 2007 10:13:35 +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=840</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[Damaged PDF generated (Chapter II)... : Hello !I&amp;#039;m still suffering...]]></title>
   <link>http://www.quickpdf.org/forum/damaged-pdf-generated-chapter-ii_topic840_post3978.html#3978</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=153">jabaltie</a><br /><strong>Subject:</strong> 840<br /><strong>Posted:</strong> 12 Dec 07 at 10:13AM<br /><br />Hello !<br><br>I'm still suffering a lot with form field replacement &amp; QuickPDF (see my other postings).<br><br>I have a PDF template, which is a PDF with empty form fields and I "stuff" content into those fields grabbing this content from a database.<br><br>So far, simple.<br><br>What happens is that SOMETIMES, a damaged PDF is generated.<br><br>I replaced QuickPDF inside my application by PDFTK, as Chicks suggested some time ago.<br><br>When using PDFTK, under the SAME CIRCUMSTANCES, I get a perfectly fine PDF.<br><br>As a matter of fact my application generates 2 PDFs : one via QuickPDF and now another one, via PDFTK, simultaneosly. That is, it generates two output files, one from each tool.<br><br>I have supplied a kit :<br><br>http://www.DES.online.unimep.br/au/pub/kitpdftk.zip<br><br>There inside :<br><ul><li>AG284D.PDF is the template itself.</li><li>LOG.TXT is a log file where I transcript the field names and values that I'm supposed to replace, from bottom up.<br></li><li>QPDF.PDF is the PDF generated via QuicPDF.</li><li>PDFTK.FDF is the FDF file that I build on my own.</li><li>PDFTK.BAT is the batch file I use to run PDFTK.<br></li><li>PDFTK.PDF is the PDF generated by PDFTK.<br></li></ul>The circumstances (EXEcutable, DATA, machine) and everything else are the SAME but QuickPDF generates a wrong PDF and PDFTK generates a OK one.<br><br>My conclusion is that there's a bug on QuickPDF field replacement or flattening.<br><br>Someone can help me ?<br><br>I see no other alternative but to replace QuickPDF by PDFTK, what I TOTALLY dislike....<br><br>My logic to replace fields on QUICKPDF is like this :<br><br>LNT:=LOQPDF:FORMFIELDCOUNT()<br><font color="#ff0099">FOR LNI:=LNT TO 1 STEP -1</font><br>&nbsp; LCFNAME:=LOQPDF:GETFORMFIELDTITLE(LNI)<br>&nbsp; IF&nbsp; EMPTY(LCFNAME)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // SHOUT 'EMPTY FORM FIELD NAME' AND GET OUT<br>&nbsp; END IF<br>&nbsp; // SEARCHES FOR THIS FORM FIELD (LCFNAME) VALUE AND IF NOT FOUND, GET OUT<br>&nbsp; IF&nbsp; (LNF:=ASCAN(LAPAGES&#091;LNIPAGE,2&#093;,{|E,I| LCFNAME == E&#091;1&#093;})) == 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // SHOUT 'FORM FIELD VALUE NOT FOUND'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // GET OUT<br>&nbsp; END IF<br>&nbsp; LCFVALUE:=LAPAGES&#091;LNIPAGE,2,LNF,2&#093;<br>&nbsp; IF&nbsp; LCFVALUE == NIL<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // SHOULD I HAVE A NULL FIELD VALUE, EMPTIES IT<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LCFVALUE := ""<br>&nbsp; END IF<br>&nbsp; IF&nbsp; NOT (LXRESULT:=<font color="#ff0099">LOQPDF:SETFORMFIELDVALUE(LNI,LCFVALUE))</font> == 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // COULD NOT SET FORM FIELD VALUE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // GET OUT<br>&nbsp; END IF<br>&nbsp; IF&nbsp; NOT (LXRESULT:=<font color="#ff0099">LOQPDF:FLATTENFORMFIELD(LNI))</font> == 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // COULD NOT FLATTEN FORM FIELD<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // GET OUT<br>&nbsp; END IF<br>&nbsp; // BUILDS FDF FILE...<br>&nbsp; LCFDF+="&lt;&lt;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + CRLF + ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/T (&#9632;" + CHR(255) + CHARMIX(REPLICATE(CHR(0),LEN(LCFNAME)),LCFNAME) + ")" + CRLF + ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/V (&#9632;" + CHR(255) + CHARMIX(REPLICATE(CHR(0),LEN(LCFVALUE)),LCFVALUE) + ")" + CRLF + ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&gt;&gt;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + CRLF<br>&nbsp; M-&gt;PCOLOG+=STRTRIM(PROCLINE()) + " CAMPO # " + STRTRIM(LNI) + " : " + LCFNAME + " / " + LCFVALUE + CRLF<br>&nbsp; // BUILDS THE LOG FILE<br>NEXT<br><br><br><br><br>]]>
   </description>
   <pubDate>Wed, 12 Dec 2007 10:13:35 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/damaged-pdf-generated-chapter-ii_topic840_post3978.html#3978</guid>
  </item> 
 </channel>
</rss>