<?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 : Page dimensions</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 : Page dimensions]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 18:12:25 +0000</pubDate>
  <lastBuildDate>Mon, 17 Apr 2017 21:57:15 +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=3453</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[Page dimensions : HiIngo,thank you for your help.I...]]></title>
   <link>http://www.quickpdf.org/forum/page-dimensions_topic3453_post13753.html#13753</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2945">RaphQuin</a><br /><strong>Subject:</strong> 3453<br /><strong>Posted:</strong> 17 Apr 17 at 9:57PM<br /><br />Hi&nbsp;<span style=": rgb251, 251, 253;">Ingo,</span><div><span style=": rgb251, 251, 253;">thank you for your help.</span></div><div><span style=": rgb251, 251, 253;">I tried with&nbsp;</span></div><div><span style=": rgb251, 251, 253;"><br></span></div><div><span style=": rgb251, 251, 253;"><span ="apple-tab-span"="" style="white-space:pre">	</span><table width="99%"><tr><td><pre class="BBcode">_dpl.NormalizePage( 0 );</span><span style=": rgb251, 251, 253;"></pre></td></tr></table></span></div><div><span style=": rgb251, 251, 253;"><br></span></div><div><span style=": rgb251, 251, 253;">&nbsp;and I still had my problem.</span></div><div><span style=": rgb251, 251, 253;">I finaly removed&nbsp;</span></div><div><span style=": rgb251, 251, 253;"><br></span></div><div><span style=": rgb251, 251, 253;"><span ="apple-tab-span"="" style="white-space:pre">	</span></span><span style=": rgb251, 251, 253;"><table width="99%"><tr><td><pre class="BBcode"></span><span style=": rgb251, 251, 253;">_dpl.SetPageSize( "A4" );</span><span style=": rgb251, 251, 253;"></pre></td></tr></table></span></div><div><span style=": rgb251, 251, 253;"><br></span></div><div><span style=": rgb251, 251, 253;">and my problem&nbsp;</span>disappeared.&nbsp;<img src="http://www.quickpdf.org/forum/smileys/smiley32.gif" border="0" alt="Clap" title="Clap" /></div><div><br></div><div>Thank you from France.</div><div><br></div><div>Regards</div><div><br></div><div>Raph.</div><span style="font-size:10px"><br /><br />Edited by RaphQuin - 17 Apr 17 at 9:58PM</span>]]>
   </description>
   <pubDate>Mon, 17 Apr 2017 21:57:15 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-dimensions_topic3453_post13753.html#13753</guid>
  </item> 
  <item>
   <title><![CDATA[Page dimensions : Hi Raph,you&amp;#039;re right - there&amp;#039;s...]]></title>
   <link>http://www.quickpdf.org/forum/page-dimensions_topic3453_post13752.html#13752</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 3453<br /><strong>Posted:</strong> 17 Apr 17 at 9:23PM<br /><br />Hi Raph,<div><br></div><div>you're right - there's a rotation setting.</div><div>So... before rendering the page was re-rotated into the original layout landscape.</div><div>The DIN A4 portrait is only the displayed state AFTER rotation.</div><div>Using the function NormalizePage you're telling the pdf that the actual displayed layout isn't made by rotation but it's the original layout.</div><div>After this function you won't have any problems while rendering:</div><div>http://www.debenu.com/docs/pdf_library_reference/NormalizePage.php</div><div><br></div><div>Cheers and welcome here,</div><div>Ingo</div><div><br></div>]]>
   </description>
   <pubDate>Mon, 17 Apr 2017 21:23:54 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-dimensions_topic3453_post13752.html#13752</guid>
  </item> 
  <item>
   <title><![CDATA[Page dimensions : HiI work with DebenuPDFLibraryDLL1212,...]]></title>
   <link>http://www.quickpdf.org/forum/page-dimensions_topic3453_post13751.html#13751</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2945">RaphQuin</a><br /><strong>Subject:</strong> 3453<br /><strong>Posted:</strong> 17 Apr 17 at 9:13PM<br /><br /><div>Hi</div><div>I work with DebenuPDFLibraryDLL1212, Visual Studio on Windows 10 Pro.</div><div>I want to render pdf in a wpf image control.</div><div><br></div><div>I tried with :&nbsp;</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div>internal Bitmap GetDAImage( int page, float resolution = 150 )</div><div>{</div><div>&nbsp; if ( _isOK ) // license OK</div><div>&nbsp; {</div><div>&nbsp; &nbsp; // on ouvre le fichier</div><div>&nbsp; &nbsp; _pdfInHandle = _dpl.DAOpenFileReadOnly( pdfIn, null );</div><div><br></div><div>&nbsp; &nbsp; // on récupère le nombre de page du fichier</div><div>&nbsp; &nbsp; _pdfPageCount = _dpl.DAGetPageCount( _pdfInHandle );</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; // on récupère la référence de la page du fichier</div><div>&nbsp; &nbsp; int pageRefNo = _dpl.DAFindPage( _pdfInHandle, page );</div><div><br></div><div>&nbsp; &nbsp; int Zoom = 72;</div><div>&nbsp; &nbsp; _pageWidth = _dpl.DAGetPageWidth( _pdfInHandle, pageRefNo ) / Zoom; &nbsp; ******** NOT OK</div><div>&nbsp; &nbsp; _pageHeight = _dpl.DAGetPageHeight( _pdfInHandle, pageRefNo ) / Zoom; ******** NOT OK</div><div><br></div><div>&nbsp; &nbsp; try</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; // on calcule les dimensions de l'image</div><div>&nbsp; &nbsp; &nbsp; b = new Bitmap( Convert.ToInt32( _pageWidth * resolution ), Convert.ToInt32( _pageHeight * resolution ) );</div><div><br></div><div>&nbsp; &nbsp; &nbsp; // on dessine l'image</div><div>&nbsp; &nbsp; &nbsp; using ( Graphics g = Graphics.FromImage( b ) )</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //int dc = (int)g.GetHdc();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //_dpl.DARenderPageToDC( _pdfInHandle, pageRefNo, resolution, dc );</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //g.ReleaseHdc( (IntPtr)dc );</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; IntPtr dc = g.GetHdc();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; _dpl.DARenderPageToDC( _pdfInHandle, pageRefNo, resolution, dc );</div><div>&nbsp; &nbsp; &nbsp; &nbsp; g.ReleaseHdc( dc );</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; catch { }</div><div>&nbsp; }</div><div><br></div><div>&nbsp; return b;</div><div>}</div></blockquote><div><br></div><div>I convert the bitmap to BitmapImage.</div><div><br></div><div>It's ok but 1 file has a problem (it came from Ricoh Aficio multifuntion).</div><div>It's a A4 format, and with pdf readers, I see it as A4 (no landscape) 21x29.7cm document.</div><div>But _dpl.DAGetPageWidth and _dpl.DAGetPageHeight give me wrong values: 29.7x21cm, not 21x29.7cm, so in my image, document is truncated in the bottom.</div><div>I inserted a new function in the beginning of my GetDAImage, to get real dimensions of the page :</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div>internal int LoadPdf( string fileName )</div><div>{</div><div>&nbsp; _fileName = fileName;</div><div><br></div><div>&nbsp; if ( _isOK ) // license OK</div><div>&nbsp; {</div><div>&nbsp; &nbsp; // on charge le fichier à copier</div><div>&nbsp; &nbsp; _dpl.LoadFromFile( fileName, null );</div><div>&nbsp; &nbsp; _dpl.SelectedDocument();</div><div><br></div><div>&nbsp; &nbsp; // on redimensionne en A4</div><div>&nbsp; &nbsp; _dpl.SetPageSize( "A4" );</div><div>&nbsp; &nbsp; // on définit l'unité de mesure ( 1/72 inches per unit )</div><div>&nbsp; &nbsp; _dpl.SetMeasurementUnits( 0 );</div><div>&nbsp; &nbsp; // on définit l'origine en haut à gauche</div><div>&nbsp; &nbsp; _dpl.SetOrigin( 1 );</div><div><br></div><div>&nbsp; &nbsp; // on récupère le nombre de page du fichier</div><div>&nbsp; &nbsp; _pdfPageCount = _dpl.PageCount();</div><div><br></div><div>&nbsp; &nbsp; // on récupère les dimensions du document</div><div>&nbsp; &nbsp; _pageWidth = _dpl.PageWidth(); &nbsp; &nbsp; &nbsp;******** OK</div><div>&nbsp; &nbsp; _pageHeight = _dpl.PageHeight(); &nbsp; &nbsp;******** OK</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; int rotation = _dpl.PageRotation();</div><div>&nbsp; &nbsp; int test = _dpl.GetOrigin();</div><div>&nbsp; }</div><div><br></div><div>&nbsp; return _pdfPageCount;</div><div>}</div></blockquote><div><br></div><div>Now it's ok.</div><div>So I tried without DA functions to avoid 2 openings :</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div>internal Bitmap GetImage( int page, float resolution = 150 )</div><div>{</div><div>&nbsp; Bitmap b = null;</div><div>&nbsp;&nbsp;</div><div>&nbsp; LoadPdf("myfile");</div><div><br></div><div>&nbsp; if ( _isOK ) // license OK</div><div>&nbsp; {</div><div>&nbsp; &nbsp; // on fait les vérification de la plages des pages</div><div>&nbsp; &nbsp; if ( page &gt; _pdfPageCount )</div><div>&nbsp; &nbsp; &nbsp; return null;</div><div><br></div><div>&nbsp; &nbsp; int Zoom = 72;</div><div>&nbsp; &nbsp; _pageWidth /= Zoom;</div><div>&nbsp; &nbsp; _pageHeight /= Zoom;</div><div><br></div><div>&nbsp; &nbsp; try</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; // on calcule les dimensions de l'image</div><div>&nbsp; &nbsp; &nbsp; b = new Bitmap( Convert.ToInt32( _pageWidth * resolution ), Convert.ToInt32( _pageHeight * resolution ) );</div><div><br></div><div>&nbsp; &nbsp; &nbsp; // on dessine l'image</div><div>&nbsp; &nbsp; &nbsp; using ( Graphics g = Graphics.FromImage( b ) )</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //int dc = (int)g.GetHdc();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //_dpl.DARenderPageToDC( _pdfInHandle, pageRefNo, resolution, dc );</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //g.ReleaseHdc( (IntPtr)dc );</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; IntPtr dc = g.GetHdc();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; _dpl.RenderPageToDC( resolution, page, dc );</div><div>&nbsp; &nbsp; &nbsp; &nbsp; g.ReleaseHdc( dc );</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; catch { }</div><div>&nbsp; }</div><div><br></div><div>&nbsp; return b;</div><div>}</div></blockquote><div><br></div><div>And now I have got a new problem :</div><div>my left and top of the document is drawn with an surprising origin in my image control:</div><div>left = +200</div><div>top = -200</div><div>so I can see only the left bottom of my document.</div><div><br></div><div>The file seems to have a rotation of 270 with 21x29.7cm dimensions.</div><div>How can I fix this problem ?</div><div><br></div><div>Regards</div><div><br></div><div>Raph</div>]]>
   </description>
   <pubDate>Mon, 17 Apr 2017 21:13:50 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/page-dimensions_topic3453_post13751.html#13751</guid>
  </item> 
 </channel>
</rss>