# FTC and PDFs?

**URL:** <https://forum.xojo.com/t/ftc-and-pdfs/25116>\
**Category:** Extras\
**Created:** [June 24, 2015, 3:55pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116 "2015-06-24T15:55:18Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 24, 2015, 3:55pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/1 "2015-06-24T15:55:18Z")

</div>

Hi,  
Does anyone know if it is possible to output a Formatted Text Control’s content as a pdf file?

I have downloaded the FTC demo from [www.bkeeney.com](http://www.bkeeney.com), but there is no pdf output option - so I’m presuming it’s not possible natively.  
However, I already own DynaPDF from MBS, so I was wondering if anyone had successfully converted an FTC’s content to pdf.

Thank you all in advance.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [June 24, 2015, 4:18pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/2 "2015-06-24T16:18:09Z")

</div>

FTC can export to rtf and html. Can DynaPDF nowadays convert one of these to PDF? I’m printing directly from html to PDF with the html-viewer. That’s a function that’s also in MBS. Then I add page numbers, headers and footers.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [June 24, 2015, 4:35pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/3 "2015-06-24T16:35:13Z")

</div>

HTML to PDF is a feature of WebKit on Mac which you can use with our plugin.  
Also RTF to PDF may be possible via loading it into a NSTextView, but you may loose a couple of features.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [June 24, 2015, 4:36pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/4 "2015-06-24T16:36:11Z")

</div>

@Bob Keeney maybe comment on this.

Maybe they have plans to add an output option for PDF via DynaPDF.  
Would require to translate calls to graphics into calls to DynaPDF, e.g. via DynaPDFGraphics class in one of the samples.

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 24, 2015, 4:45pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/5 "2015-06-24T16:45:02Z")

</div>

Beatrix,  
So basically I could use FTC to output to HTML - then load that newly created HTML into an HTMLViewer, and then from there, save as a pdf?

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [June 24, 2015, 4:50pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/6 "2015-06-24T16:50:59Z")

</div>

yes, on a Mac.

---

<div class="post-metadata">

**Author:** ![Bob\_Keeney](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bob\_Keeney](https://forum.xojo.com/u/Bob_Keeney)\
**Post date:** [June 24, 2015, 4:52pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/7 "2015-06-24T16:52:59Z")

</div>

FTC does not have that currently. It’s a long term plan to add it and there has been _some_ work done on it but it’s not nearly ready for testing or release. If I were pressed to come out with something soon it would have to use the MBS DynaPDF plugin.

But it does export to rtf and html.

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 24, 2015, 5:32pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/8 "2015-06-24T17:32:42Z")

</div>

Bob,  
I need pdf only, so I guess I will have to output to HTML, then either load into a HTMLViewer and output to pdf from there.

Alternatively, output to HTML, and then use DynaPDF to output to pdf.

Hmmm, this should be fun - NOT! 🙂

---

<div class="post-metadata">

**Author:** ![David\_Cox](https://forum.xojo.com/user_avatar/forum.xojo.com/david_cox/32/227_2.png) [@David\_Cox](https://forum.xojo.com/u/David_Cox)\
**Post date:** [June 24, 2015, 5:43pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/9 "2015-06-24T17:43:42Z")

</div>

Richard, of course you must know of [http://wkhtmltopdf.org](http://wkhtmltopdf.org) (free for Mac, Win and Linux).

I create a temporary HTML file with HTML formatted text plus embedded ChartDirector charts, then convert it to PDF using wkhtmltopdf, then display the resulting PDF in an HTMLViewer for my WebApps.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [June 24, 2015, 6:16pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/10 "2015-06-24T18:16:04Z")

</div>

PDF is never fun. As programming language it’s as complicated as Xojo. If you go the html route you need to remember that loading html in a thread crashes the app. wkhtmltopdf is rather large. For MBS creating the pdf is very simple:

` dim tempItem as FolderItem = getTempFolderitem
    call HTMLViewer1.PrintToPDFFileMBS(tempItem, 50, 50, 50, 50)`

---

<div class="post-metadata">

**Author:** ![Richard\_Summers](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_summers/32/477_2.png) [@Richard\_Summers](https://forum.xojo.com/u/Richard_Summers)\
**Post date:** [June 24, 2015, 7:04pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/11 "2015-06-24T19:04:12Z")

</div>

David,  
Thanks - I will take a look.

Beatrix,  
Thanks for that code. Just out of curiosity - what does 50, 50, 50, 50 refer to?  
Is that some kind of padding / border values?

Thanks Guys.

---

<div class="post-metadata">

**Author:** ![Simon\_Berridge](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/cc9497/32.png) [@Simon\_Berridge](https://forum.xojo.com/u/Simon_Berridge)\
**Post date:** [June 25, 2015, 1:04am UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/12 "2015-06-25T01:04:55Z")

</div>

[quote=196489:@Beatrix Willius]PDF is never fun. As programming language it’s as complicated as Xojo. If you go the html route you need to remember that loading html in a thread crashes the app. wkhtmltopdf is rather large. For MBS creating the pdf is very simple:

` dim tempItem as FolderItem = getTempFolderitem
    call HTMLViewer1.PrintToPDFFileMBS(tempItem, 50, 50, 50, 50)`[/quote]  
This works really well.

Thank you.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [June 25, 2015, 4:41am UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/13 "2015-06-25T04:41:58Z")

</div>

@Richard: have a look at [https://www.monkeybreadsoftware.net/cocoa-htmlviewer-method.shtml](https://www.monkeybreadsoftware.net/cocoa-htmlviewer-method.shtml)

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [June 25, 2015, 6:44am UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/14 "2015-06-25T06:44:03Z")

</div>

hi,  
when you buy FTC at $150, do you get full unencrypted source code or not ?  
not clear on Bob web site.  
thanks.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:49pm UTC](https://forum.xojo.com/t/ftc-and-pdfs/25116/15 "2020-10-29T17:49:08Z")

</div>


