FTC and PDFs?

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, 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.

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.

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.

@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.

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.

yes, on a Mac.

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.

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! :slight_smile:

Richard, of course you must know of 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.

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)

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.

[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.

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

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