<?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 : &quot;Empty&quot; fields in form.</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 : &quot;Empty&quot; fields in form.]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 01 May 2026 04:56:54 +0000</pubDate>
  <lastBuildDate>Thu, 23 May 2013 07:22:02 +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=2647</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[&quot;Empty&quot; fields in form. : Now that you say it, it&amp;#039;s...]]></title>
   <link>http://www.quickpdf.org/forum/empty-fields-in-form_topic2647_post10879.html#10879</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2378">ClasG</a><br /><strong>Subject:</strong> 2647<br /><strong>Posted:</strong> 23 May 13 at 7:22AM<br /><br />Now that you say it, it's obvious...&nbsp;<img src="http://www.quickpdf.org/forum/smileys/smiley9.gif" border="0" alt="Embarrassed" title="Embarrassed" /><div><br></div><div>Great, thanks Andrew.</div>]]>
   </description>
   <pubDate>Thu, 23 May 2013 07:22:02 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/empty-fields-in-form_topic2647_post10879.html#10879</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;Empty&quot; fields in form. : Clas,You should flatten the formfields...]]></title>
   <link>http://www.quickpdf.org/forum/empty-fields-in-form_topic2647_post10878.html#10878</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1483">AndrewC</a><br /><strong>Subject:</strong> 2647<br /><strong>Posted:</strong> 23 May 13 at 5:47AM<br /><br /><div>Clas,</div><div><br></div>You should flatten the formfields backwards because FormFieldCount is decremented after a field is flattened. &nbsp;You will find that your code will start to work a little better.<div><br></div><div>Andrew.</div>]]>
   </description>
   <pubDate>Thu, 23 May 2013 05:47:37 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/empty-fields-in-form_topic2647_post10878.html#10878</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;Empty&quot; fields in form. :  Hi.I&amp;#039;m evaluating QuickPDF...]]></title>
   <link>http://www.quickpdf.org/forum/empty-fields-in-form_topic2647_post10863.html#10863</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2378">ClasG</a><br /><strong>Subject:</strong> 2647<br /><strong>Posted:</strong> 21 May 13 at 3:22PM<br /><br />Hi.<div><br></div><div>I'm evaluating QuickPDF and some other libraries for my company. I'm trying to fill a form with data, but can't find a fully functioning way to go.</div><div><br></div><div>This code snip has two ways of iterating the fields - with&nbsp;<span style="font-family: 'Courier New', Courier, mono; line-height: 1.4;">LoopXML</span><span style="line-height: 1.4;">&nbsp;defined, the source data is iterated and the value of the form field with the matching name is set. If&nbsp;</span><span style="line-height: 1.4; font-family: 'Courier New', Courier, mono;">LoopXML</span><span style="line-height: 1.4;">&nbsp;</span><span style="line-height: 1.4;">isn't&nbsp;</span>defined<span style="line-height: 1.4;">, it iterates through the fields in the form and tries to find the matching name in the XML source, read it and set the value.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>int nMainDocID = -1;</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>XmlDocument xml_doc = new XmlDocument();</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>xml_doc.LoadXml(sResponse);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>foreach (<span ="apple-tab-span"="" style="white-space:pre">	</span>XmlNode page in</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>xml_doc.SelectNodes("//Report/Page"))</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>int ec = QP.LoadFromFile(sReportFilename + ".pdf", "");</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>if (ec != 1)</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>Response.Write("&lt;br&gt;Report can not be loaded!");</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>return;</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>}</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>int nCurrentDocID = QP.SelectedDocument();</font></div><div><font face="Courier New, Courier, mono">#if LoopXML</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>foreach (XmlNode n in page)</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>{</font></div><div><span ="apple-tab-span"="" style="font-family: 'Courier New', Courier, mono; line-height: 1.4; white-space: pre;">			</span><span style="font-family: 'Courier New', Courier, mono; line-height: 1.4;">ec = QP.SetFormFieldValueByTitle(n.Name, n.InnerText);</span></div><div><span ="apple-tab-span"="" style="font-family: 'Courier New', Courier, mono; line-height: 1.4; white-space: pre;">		</span><span style="font-family: 'Courier New', Courier, mono; line-height: 1.4;">}</span></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>int nFC = QP.FormFieldCount();</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>for (int i = 0; i &lt; nFC; i++)</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>QP.UpdateAndFlattenFormField(i);</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>}</font></div><div><font face="Courier New, Courier, mono">#else</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>int nFailCount = 0;</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>int nFC = QP.FormFieldCount();</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>for (int i = 0; i &lt; nFC; i++)</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>string sField = QP.GetFormFieldTitle(i);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>if (sField == null || sField.Trim() == "")</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">				</span>QP.FlattenFormField(i); // "Remove" field</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">				</span>nFailCount++;</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">				</span>continue;</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>}</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>XmlNode n = page.SelectSingleNode("./" + sField);</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>if (n != null)</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">				</span>QP.SetFormFieldValue(i, n.InnerText);</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">				</span>QP.UpdateAndFlattenFormField(i);</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>}</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>else</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">				</span>QP.FlattenFormField(i); // "Remove" field</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>}</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>}</font></div><div><font face="Courier New, Courier, mono">#endif</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>if (nMainDocID == -1)</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>nMainDocID = nCurrentDocID;</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>}</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>else</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>QP.SelectDocument(nMainDocID);</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">			</span>QP.MergeDocument(nCurrentDocID);</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>}</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>}</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>Response.ContentType = "application/pdf";</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>Response.AddHeader("Content-disposition", "attachment; filename=" +</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">		</span>GetQueryParam("RPT") + ".pdf");</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>Response.BinaryWrite((byte &#091;&#093;)QP.SaveToVariant());</font></div><div><font face="Courier New, Courier, mono"><span ="apple-tab-span"="" style="white-space:pre">	</span>Response.End();</font></div></div><div><br></div><div><span style="line-height: 1.4;">Neither of these ways work all the way...</span></div><div><span style="line-height: 1.4;"><br></span></div><div>The first one successfully sets all field data, but there's no way of flattening the fields. The loop after setting the data, that attempts to flatten the fields, fails. Probably for the same reason the second way fails;</div><div><span style="line-height: 1.4;">half way through the fields (110 of 218) the field names comes up as empty, and there's no name to find in the source data <img src="http://www.quickpdf.org/forum/smileys/smiley3.gif" border="0" alt="Shocked" title="Shocked" />.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">The PDF with the form:</span></div><div><span style="line-height: 1.4;"><a href="http://www.filedropper.com/fk3059" target="_blank">http://www.filedropper.com/fk3059</a><br></span></div><div><br></div><div><span style="line-height: 1.4;">Any ideas...?</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">Another unrelated question is if there's a better way to duplicate the original document. This source document should be repeated for each&nbsp;</span><span style="line-height: 1.4; font-family: 'Courier New', Courier, mono;">Page</span><span style="line-height: 1.4;">-tag in the source. The only way I found to do that was to actually load the document from the file again, which seems&nbsp;unnecessary</span><span style="line-height: 1.4;">... This is also one of the reasons I need to flatten the fields (to avoid duplicates).</span></div><div><br></div><div>Grateful for rapid replies..</div><div><br></div><div>Regards,</div><div>Clas</div><span style="font-size:10px"><br /><br />Edited by ClasG - 21 May 13 at 3:25PM</span>]]>
   </description>
   <pubDate>Tue, 21 May 2013 15:22:32 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/empty-fields-in-form_topic2647_post10863.html#10863</guid>
  </item> 
 </channel>
</rss>