<?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 : DrawImage function problem</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 : DrawImage function problem]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 30 May 2026 05:27:27 +0000</pubDate>
  <lastBuildDate>Mon, 11 Jun 2012 22:22:05 +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=2296</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[DrawImage function problem : How about using vector-logos?...]]></title>
   <link>http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9756.html#9756</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=270">Autodidact</a><br /><strong>Subject:</strong> 2296<br /><strong>Posted:</strong> 11 Jun 12 at 10:22PM<br /><br />How about using vector-logos? If the logo don't have to be in bitmap, which it rarely should/do, you could have a crisp logo scaled to any size — with a very low disk footprint.]]>
   </description>
   <pubDate>Mon, 11 Jun 2012 22:22:05 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9756.html#9756</guid>
  </item> 
  <item>
   <title><![CDATA[DrawImage function problem : Mea culpa.Thank you Andrew for...]]></title>
   <link>http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9755.html#9755</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=987">alinux</a><br /><strong>Subject:</strong> 2296<br /><strong>Posted:</strong> 11 Jun 12 at 7:50PM<br /><br />Mea culpa.<br><br>Thank you Andrew for your explanation and your time.<br><br>alinux<br><br>]]>
   </description>
   <pubDate>Mon, 11 Jun 2012 19:50:06 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9755.html#9755</guid>
  </item> 
  <item>
   <title><![CDATA[DrawImage function problem : ImageWidth and ImageHeight return...]]></title>
   <link>http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9749.html#9749</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1483">AndrewC</a><br /><strong>Subject:</strong> 2296<br /><strong>Posted:</strong> 08 Jun 12 at 11:53AM<br /><br /><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">ImageWidth and ImageHeight return a value in pixels so you cannot use this pixel value directly in DrawImage as it require a location in points (72 points = 1 inch)</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">Here is some code that will do what you need.</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; QP.SetMeasurementUnits(0);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; int dpix = QP.ImageHorizontalResolution();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; int dpiy = QP.ImageVerticalResolution();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; if (dpix == 0) dpix = 72;</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; if (dpiy == 0) dpiy = 72;</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; int xx = QP.ImageWidth();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; int yy = QP.ImageHeight();</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; double ImageWidthInPoints = (double)QP.ImageWidth() / dpix * 72.0; // assumming dpi units</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; double ImageHeightInPoints = (double)QP.ImageHeight() / dpiy * 72.0;</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">&nbsp; &nbsp; QP.DrawImage(0, 0, ImageWidthInPoints, ImageHeightInPoints);</span><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><br style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; "><span style="font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: normal; ">Andrew.</span>]]>
   </description>
   <pubDate>Fri, 08 Jun 2012 11:53:12 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9749.html#9749</guid>
  </item> 
  <item>
   <title><![CDATA[DrawImage function problem : Hi Andrew,I&amp;#039;d like only to...]]></title>
   <link>http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9744.html#9744</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=987">alinux</a><br /><strong>Subject:</strong> 2296<br /><strong>Posted:</strong> 07 Jun 12 at 5:17PM<br /><br />Hi Andrew,<br><br>I'd like only to draw an image (a logo for example) into a PDF. As result I have a "pixelated" image&nbsp; into the pdf.<br><br>I only load image from resources file (c# .Net) and use drawimage function. Same result with drawscaledimage function (scale level = 1):<br><br>MemoryStream ms = new MemoryStream();<br>Image img = ProjectName.ResourceFile.bpo_logo;<br>img.Save(ms, ImageFormat.Jpeg);<br>qp.AddImageFromVariant(ms.ToArray(), 0);<br>qp.SelectImage(qp.GetImageID(1));<br>qp.DrawImage(30, 30, qp.ImageWidth(), qp.ImageHeight());<br><br>I have the same result with all image formats (BMP, TIF, GIF, JPG, PNG).<br><br>alinux<br><br>]]>
   </description>
   <pubDate>Thu, 07 Jun 2012 17:17:39 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9744.html#9744</guid>
  </item> 
  <item>
   <title><![CDATA[DrawImage function problem : Can you post a code sample.PostScript...]]></title>
   <link>http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9737.html#9737</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1483">AndrewC</a><br /><strong>Subject:</strong> 2296<br /><strong>Posted:</strong> 07 Jun 12 at 2:00PM<br /><br />Can you post a code sample.<div><br></div><div>PostScript and PDF scale the image to the required size so the resolution will change. &nbsp;This is how it is designed to work.</div><div><br></div><div>What exactly are you trying to acheive ? &nbsp;smaller filesize ?</div><div><br></div><div>Andrew.</div>]]>
   </description>
   <pubDate>Thu, 07 Jun 2012 14:00:03 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9737.html#9737</guid>
  </item> 
  <item>
   <title><![CDATA[DrawImage function problem : Hello,Using DrawImage/DrawScaledImage...]]></title>
   <link>http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9734.html#9734</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=987">alinux</a><br /><strong>Subject:</strong> 2296<br /><strong>Posted:</strong> 07 Jun 12 at 9:08AM<br /><br />Hello,<br><br>Using DrawImage/DrawScaledImage alter image resolution (any image format) in PDF (even using ImageHorizontalResolution &amp; ImageVerticalResolution).<br><br>Do anyone have an idea to how avoid this?<br><br>Thanks,<br>alinux<br>]]>
   </description>
   <pubDate>Thu, 07 Jun 2012 09:08:35 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/drawimage-function-problem_topic2296_post9734.html#9734</guid>
  </item> 
 </channel>
</rss>