<?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 : Deleting indirect &#111;bjects</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 : Deleting indirect &#111;bjects]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 20:10:21 +0000</pubDate>
  <lastBuildDate>Sun, 05 Feb 2006 02:24:51 +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=305</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[Deleting indirect &#111;bjects : It probably won&amp;#039;t work for...]]></title>
   <link>http://www.quickpdf.org/forum/deleting-indirect-objects_topic305_post1302.html#1302</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=261">cycle</a><br /><strong>Subject:</strong> 305<br /><strong>Posted:</strong> 05 Feb 06 at 2:24AM<br /><br />It probably won't work for them. It looks like COM and DLL wrappers only expose the top level interface, TiSedQuickPdf class, not the underlying classes, and pdf objects (Cos layer in Adobe terms) are pretty low level.]]>
   </description>
   <pubDate>Sun, 05 Feb 2006 02:24:51 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/deleting-indirect-objects_topic305_post1302.html#1302</guid>
  </item> 
  <item>
   <title><![CDATA[Deleting indirect &#111;bjects : This looks like it will work well...]]></title>
   <link>http://www.quickpdf.org/forum/deleting-indirect-objects_topic305_post1301.html#1301</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=173">swb1</a><br /><strong>Subject:</strong> 305<br /><strong>Posted:</strong> 04 Feb 06 at 5:31PM<br /><br />This looks like it will work well for Delphi programmers but what about ActiveX and DLL users? <span style="font-size:10px"><br /><br />Edited by swb1</span>]]>
   </description>
   <pubDate>Sat, 04 Feb 2006 17:31:10 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/deleting-indirect-objects_topic305_post1301.html#1301</guid>
  </item> 
  <item>
   <title><![CDATA[Deleting indirect &#111;bjects : Here is an observation I made...]]></title>
   <link>http://www.quickpdf.org/forum/deleting-indirect-objects_topic305_post1296.html#1296</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=261">cycle</a><br /><strong>Subject:</strong> 305<br /><strong>Posted:</strong> 04 Feb 06 at 6:55AM<br /><br />Here is an observation I made while using this library.<br /><br />Suppose you are editing a pdf file and you want to delete an indirect object that is referenced from a dictionary.<br />The relevant portions of the file can look like this<br /><br /><font face="Courier New, Courier, mono">1000 0 obj &lt;&lt; /StreamKey 2000 0 R /OtherKey whatever&gt;&gt;<br />endobj<br /><br />...<br /><br />2000 0 obj &lt;&lt; /Length 34141 &gt;&gt; stream<br />... stream contents ...<br />endstream<br />endobj</font><br /><br />How do you delete this stream?<br /><br />Maybe<br /><font face="Courier New, Courier, mono"><br />doc:TPDFDocument;<br />dict:TPDFDictionary;<br />obj:TPDFObject;<br />ref:TPdfIndRef;<br /><br />obj:=dict.FindValueByKeyName('StreamKey', true);<br />obj.Purge;</font><br /><br />No, it produces an error during saving. Similarly, the following code will not work either.<br /><br /><font face="Courier New, Courier, mono">obj:=dict.FindValueByKeyName('StreamKey', false);<br />if obj is TPDFIndRef then begin<br />  ref:=TPDFIndRef(obj);<br />  ref.Obj.Purge;<br />  ref.Purge<br />end;</font><br /><br />Looking closer, one can find procedure TPDFDocument.DeleteObj(ObjNum, GenNum) that does exactly what needed. But alas, it is not public.<br /><br />Fortunately, there is a way around that does not require modifying the library source. The address of this procedure is assigned to a published property of PageTree field. The final code is<br /><br /><font face="Courier New, Courier, mono">ref:=TPDFIndRef(obj);<br />doc.PageTree.OnDeleteObj(ref.ObjNum, ref.GenNum);<br />and<br />dict.PurgeKey('StreamKey');</font><br /><br />It works, but it is not exactly trivial.<br />]]>
   </description>
   <pubDate>Sat, 04 Feb 2006 06:55:30 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/deleting-indirect-objects_topic305_post1296.html#1296</guid>
  </item> 
 </channel>
</rss>