<?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 : Reduce PDF file size</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 : Reduce PDF file size]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 01 May 2026 07:54:04 +0000</pubDate>
  <lastBuildDate>Thu, 13 Mar 2014 19:04: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=2846</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[Reduce PDF file size : I use the following codes to convert...]]></title>
   <link>http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11556.html#11556</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1239">kk aw</a><br /><strong>Subject:</strong> 2846<br /><strong>Posted:</strong> 13 Mar 14 at 7:04PM<br /><br />I use the following codes to convert the bmp image format to jpg image format:<div><br></div><div><div>procedure TMainform.ConvertImage1Click(Sender: TObject);</div><div>var</div><div>&nbsp; i,j,n: Integer;</div><div>&nbsp; ImgID, nImgID: Integer;</div><div>&nbsp; ImgCount: Integer;</div><div>&nbsp; ImgName1, ImgName2: widestring;</div><div>&nbsp; ImgType: Integer;</div><div>&nbsp; ImgConverted: Integer;</div><div>&nbsp; FPrivdir: string;</div><div>&nbsp; FileExt: string;</div><div>&nbsp; FFileName: string;</div><div>&nbsp; retval: Integer;</div><div>&nbsp; Fsize1, FSize2: Integer;</div><div>begin</div><div>&nbsp; Screen.Cursor := crHourGlass;</div><div>&nbsp; FPrivdir:= sm.slashAdd(LmdSysInfo1.TempPath);</div><div>&nbsp; FileExt:= sm.locase(ElcomboBox1.Text);</div><div>&nbsp; FSize1:= Qp.GetDocumentFileSize;</div><div>&nbsp; ImgConverted:= 0;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; ImgCount := Qp.FindImages;</div><div>&nbsp; &nbsp; j:= 1;</div><div>&nbsp; &nbsp; imgId := QP.GetImageID(j);</div><div>&nbsp; &nbsp; while j &lt;= ImgCount do</div><div>&nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; qp.SelectImage(ImgID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ImgType := Qp.ImageType;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ImgType = 2 then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImgName1 := FPrivdir + Format('PdfImage%d.bmp',&#091;j&#093;);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImgName2 := FPrivdir + Format('PdfImage%d.%s',&#091;j,FileExt&#093;);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QP.SaveImageToFile(Imgname1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If sm.EqualIC(FileExt,'jpg') then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Bmp2Jpeg(ImgName1, ImgName2)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if sm.EqualIC(FileExt,'gif') then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if sm.EqualIC(FileExt,'png') then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If FileExists(imgname2) then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nImgID:= qp.AddImageFromFile(ImgName2,0);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if nImgID = 0 then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('Cannot addimagefromfile '+ImgName2);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage(ImgName2 + ' not found');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; retval:= qp.ReplaceImage(ImgID, nImgID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If retval = 0 then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowStatusBar('Image not replaced');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sleep(500);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; retval:= qp.ClearImage(ImgID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If retval = 0 then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('Image not cleared');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FSize2:= Qp.GetDocumentFileSize;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Inc(ImgConverted);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Inc(j);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; imgId := QP.GetImageID(j);</div><div>&nbsp; &nbsp; &nbsp; end;</div><div>&nbsp; &nbsp; Screen.Cursor := crDefault;</div><div>&nbsp; &nbsp; If ImgConverted &gt; 0 then</div><div>&nbsp; &nbsp; &nbsp; begin</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage(Format('%d Embedded images successfully converted.'+crlf+</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'Originalsize: %d &nbsp;New size: %d',&#091;ImgConverted, FSize1, FSize2&#093;));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; FFileName:= FSelectedFile;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; n:= sm.posIC('.pdf', FFileName);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.Insert('&#091;IR&#093;',FFileName, n);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Qp.SaveToFile(FFileName); &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; end</div><div>&nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; ShowStatusBar('No image to convert or converted');</div><div>&nbsp; finally</div><div>&nbsp; &nbsp; Screen.Cursor := crDefault;</div><div>&nbsp; end;</div><div>end;</div><div><br></div><div>procedure TMainform.Bmp2Jpeg(const BmpFileName, JpgFileName: string);</div><div>var</div><div>&nbsp; Bmp: TBitmap;</div><div>&nbsp; Jpg: TJPEGImage;</div><div>begin</div><div>&nbsp; Bmp := TBitmap.Create;</div><div>&nbsp; Jpg := TJPEGImage.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; Bmp.LoadFromFile(BmpFileName);</div><div>&nbsp; &nbsp; Jpg.Assign(Bmp);</div><div>&nbsp; &nbsp; Jpg.SaveToFile(JpgFileName);</div><div>&nbsp; finally</div><div>&nbsp; &nbsp; Jpg.Free;</div><div>&nbsp; &nbsp; Bmp.Free;</div><div>&nbsp; end;</div><div>end;</div></div><div><br></div><div>The image files in bmp and jpg as exported. &nbsp;</div><div>The retval in the line:&nbsp;<span style="line-height: 1.4;">&nbsp; retval:= qp.ReplaceImage(ImgID, nImgID) is always 0.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">If I carry one regardless, qp.clearimage(imgid) returns 1.....</span></div><div><span style="line-height: 1.4;"><br></span></div><div>The image-replaced file size is slightly bigger than the original.</div><div><br></div><div>Any ideas what is happening?</div><div><br></div><div><span style="line-height: 1.4;"><br></span></div>]]>
   </description>
   <pubDate>Thu, 13 Mar 2014 19:04:35 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11556.html#11556</guid>
  </item> 
  <item>
   <title><![CDATA[Reduce PDF file size : In versions of Debenu Quick PDF...]]></title>
   <link>http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11555.html#11555</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1483">AndrewC</a><br /><strong>Subject:</strong> 2846<br /><strong>Posted:</strong> 12 Mar 14 at 11:50PM<br /><br />In versions of Debenu Quick PDF Library since version 8 or so the CompressImages flag has been set to true.<div><br></div><div>This flag does not resize images. All it does is turn on image compression so that when a PDF file is saved then the image data is compressed and stored much like a Zip file compresses a file.&nbsp;<span style="line-height: 1.4;">&nbsp;</span><span style="line-height: 1.4;">&nbsp;If the image data in the PDF is not compressed (quite rare these days) then compressing it will save some space. &nbsp;Most files will not be affected.</span></div><div><br></div><div>Currently if you would like to resample and downscale images then you would need to extract the image, load the image into an image processing library such as ImageEn, ImageMagick - process it and then call QP.ReplaceImage to replace the image with smaller compressed, lower quality image data. &nbsp;</div><div><br></div><div>Andrew.<br><div><br></div></div>]]>
   </description>
   <pubDate>Wed, 12 Mar 2014 23:50:05 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11555.html#11555</guid>
  </item> 
  <item>
   <title><![CDATA[Reduce PDF file size :  I expect you&amp;#039;ve already...]]></title>
   <link>http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11554.html#11554</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2360">AndyD</a><br /><strong>Subject:</strong> 2846<br /><strong>Posted:</strong> 12 Mar 14 at 10:30AM<br /><br />I expect you've already tried this but just in case, have you used the compress page function so that QP reduces your PDF as much as possible?<div>&nbsp;</div><div>For a = 1 To QP.PageCount<br>&nbsp;&nbsp;&nbsp; Call QP.SelectPage(a)<br>&nbsp;&nbsp;&nbsp; Call QP.CompressPage<br>Next a</div><div>QP.SaveToFile (SaveString)</div><div>&nbsp;</div><div>Worth mentioning just in case.</div>]]>
   </description>
   <pubDate>Wed, 12 Mar 2014 10:30:15 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11554.html#11554</guid>
  </item> 
  <item>
   <title><![CDATA[Reduce PDF file size : I have a large pdf document, and...]]></title>
   <link>http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11553.html#11553</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1239">kk aw</a><br /><strong>Subject:</strong> 2846<br /><strong>Posted:</strong> 12 Mar 14 at 10:14AM<br /><br /><div>I have a large pdf document, and I want to reduce the document size.</div><div><br></div><div>Can I use replaceimage and clearimage to reduce the document size?</div><div><br></div><div>In my test with both version 9.16 and 10.13, it does not seem to work.</div><div><br></div><div>The replaceimage function always returned 0. &nbsp;Does this mean that it failed?</div><div><br></div><div>Using the clearimage function by itself works and the image is no longer visible in the document. Unfortunately, the filesize is not reduced.</div><div><br></div><div><br></div><div><br></div><div></div>]]>
   </description>
   <pubDate>Wed, 12 Mar 2014 10:14:18 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/reduce-pdf-file-size_topic2846_post11553.html#11553</guid>
  </item> 
 </channel>
</rss>