<?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 : Convert RTF to PDF</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 : Sample Code : Convert RTF to PDF]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 11 May 2026 23:26:15 +0000</pubDate>
  <lastBuildDate>Thu, 24 May 2012 22:21:29 +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=1266</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[Convert RTF to PDF : Hi!You&amp;#039;ve seen that this...]]></title>
   <link>http://www.quickpdf.org/forum/convert-rtf-to-pdf_topic1266_post9640.html#9640</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 1266<br /><strong>Posted:</strong> 24 May 12 at 10:21PM<br /><br />Hi!<br><br>You've seen that this post is long ago ...<br>I won't hope for a new delphi code ...<br>Try it yourself for a new sample for us here ;-)<br><br>Cheers and welcome here,<br>Ingo<br><br>]]>
   </description>
   <pubDate>Thu, 24 May 2012 22:21:29 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/convert-rtf-to-pdf_topic1266_post9640.html#9640</guid>
  </item> 
  <item>
   <title><![CDATA[Convert RTF to PDF : Helo, thanx 4 example, but May...]]></title>
   <link>http://www.quickpdf.org/forum/convert-rtf-to-pdf_topic1266_post9637.html#9637</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1947">jurand</a><br /><strong>Subject:</strong> 1266<br /><strong>Posted:</strong> 24 May 12 at 9:41AM<br /><br /><DIV>Helo, thanx 4 example, but</DIV><DIV>May you axplain your idea, I'll try this on Delphi,</DIV><DIV>unfortunately I can't get this code idea</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 24 May 2012 09:41:22 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/convert-rtf-to-pdf_topic1266_post9637.html#9637</guid>
  </item> 
  <item>
   <title><![CDATA[Convert RTF to PDF : Here is a sample code writen with...]]></title>
   <link>http://www.quickpdf.org/forum/convert-rtf-to-pdf_topic1266_post5806.html#5806</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=129">DELBEKE</a><br /><strong>Subject:</strong> 1266<br /><strong>Posted:</strong> 05 Nov 09 at 10:42AM<br /><br />Here is a sample code writen with VB6 to transform an RTF file into a Pdf file, using the new functions GetCanvasDc &amp; LoadFromCanvasDc <DIV>&nbsp;</DIV><BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr><DIV>Option Explicit<BR>Private Type RECT<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Left As Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Top As Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Right As Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bottom As Long<BR>End Type</DIV><DIV>Private Type CharRange<BR>&nbsp;&nbsp;&nbsp;&nbsp; cpMin As Long&nbsp;&nbsp;&nbsp;&nbsp; ' First character of range (0 for start of doc)<BR>&nbsp;&nbsp;&nbsp;&nbsp; cpMax As Long&nbsp;&nbsp;&nbsp;&nbsp; ' Last character of range (-1 for end of doc)<BR>End Type</DIV><DIV>Private Type FormatRange<BR>&nbsp;&nbsp;&nbsp;&nbsp; hDc As Long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Actual DC to draw on<BR>&nbsp;&nbsp;&nbsp;&nbsp; hdcTarget As Long ' Target DC for determining text formatting<BR>&nbsp;&nbsp;&nbsp;&nbsp; rc As RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Region of the DC to draw to (in twips)<BR>&nbsp;&nbsp;&nbsp;&nbsp; RcPage As RECT&nbsp;&nbsp;&nbsp; ' Region of the entire DC (page size) (in twips)<BR>&nbsp;&nbsp;&nbsp;&nbsp; chrg As CharRange ' Range of text to draw (see above declaration)<BR>End Type<BR>Private Const WM_USER As Long = &amp;H400<BR>Private Const EM_FORMATRANGE As Long = WM_USER + 57<BR>Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long</DIV><DIV><BR>Dim Doc As New QuickPDFAX0717.PDFLibrary<BR>Private Sub Form_Load()<BR>&nbsp; Doc.UnlockKey "j53g77ru93q3ds9kw7ru59b8y" 'trial key<BR>&nbsp; 'Size RichTextBox1 to A4 format<BR>&nbsp; RichTextBox1.Move 0, 0, ScaleX(210, vbMillimeters, vbTwips), ScaleY(297, vbMillimeters, vbTwips)<BR>&nbsp; 'load some test file<BR>&nbsp; RichTextBox1.LoadFile App.Path &amp; "\Test.rtf"<BR>End Sub</DIV><DIV>Private Sub Command1_Click()<BR>&nbsp; Dim Dc As Long<BR>&nbsp; Dim PageNumber As Long<BR>&nbsp; Dim LastChar As Long<BR>&nbsp; Dim DocId As Long<BR>&nbsp; PageNumber = 1<BR>&nbsp; LastChar =&nbsp;0<BR>&nbsp; Do<BR>&nbsp;&nbsp;&nbsp; 'get a virtual device context size at A4<BR>&nbsp;&nbsp;&nbsp; Dc = Doc.GetCanvasDC(ScaleX(210, vbMillimeters, vbPixels), ScaleY(297, vbMillimeters, vbPixels))<BR>&nbsp;&nbsp;&nbsp; 'print the rtfbox<BR>&nbsp;&nbsp;&nbsp; LastChar = ImprimeRtfBox(Dc, RichTextBox1, LastChar)<BR>&nbsp;&nbsp;&nbsp; 'generate a new document<BR>&nbsp;&nbsp;&nbsp; Doc.LoadFromCanvasDc 96, 0<BR>&nbsp;&nbsp;&nbsp; DocId = Doc.SelectedDocument<BR>&nbsp;&nbsp;&nbsp; 'save it to file<BR>&nbsp;&nbsp;&nbsp; Doc.SaveToFile App.Path &amp; "\Test" &amp; CStr(PageNumber) &amp; ".pdf"<BR>&nbsp;&nbsp;&nbsp; 'remove it from memory<BR>&nbsp;&nbsp;&nbsp; Doc.RemoveDocument DocId<BR>&nbsp;&nbsp;&nbsp; PageNumber = PageNumber + 1<BR>&nbsp; Loop While LastChar &lt;&gt; 0<BR>&nbsp; MsgBox "Done"<BR>End Sub</DIV><DIV>Public Function ImprimeRtfBox(hDc As Long, rtfBox As RichTextBox, FirstChar As Long)<BR>&nbsp; Dim RcDrawTo As RECT<BR>&nbsp; Dim RcPage As RECT<BR>&nbsp; Dim Fr As FormatRange<BR>&nbsp; Dim NextCharPosition As Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcPage.Left = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcPage.Right = rtfBox.Left + rtfBox.Width + 100<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcPage.Top = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcPage.Bottom = rtfBox.Top + rtfBox.Height + 100<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcDrawTo.Left = rtfBox.Left<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcDrawTo.Top = rtfBox.Top<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcDrawTo.Right = rtfBox.Left + rtfBox.Width<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RcDrawTo.Bottom = rtfBox.Top + rtfBox.Height<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fr.hDc = hDc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fr.hdcTarget = hDc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fr.rc = RcDrawTo<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fr.RcPage = RcPage<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fr.chrg.cpMin = FirstChar<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fr.chrg.cpMax = -1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NextCharPosition = SendMessage(rtfBox.hWnd, EM_FORMATRANGE, True, Fr)<BR>&nbsp;&nbsp;&nbsp; If NextCharPosition &lt; Len(rtfBox.text) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImprimeRtfBox = NextCharPosition<BR>&nbsp;&nbsp;&nbsp; Else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImprimeRtfBox = 0<BR>&nbsp;&nbsp;&nbsp; End If<BR>End Function</DIV><DIV>&nbsp;</DIV></BLOCKQUOTE><DIV dir=ltr>Hope this may be usefull.<BR></DIV><span style="font-size:10px"><br /><br />Edited by DELBEKE - 05 Nov 09 at 10:50AM</span>]]>
   </description>
   <pubDate>Thu, 05 Nov 2009 10:42:12 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/convert-rtf-to-pdf_topic1266_post5806.html#5806</guid>
  </item> 
 </channel>
</rss>