• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Multiple RTF to one PDF on the Fly

New Here ,
Dec 10, 2007 Dec 10, 2007

Copy link to clipboard

Copied

We have a little department that have a lot of our records stored in a SQL db as RTF. We have created a search form that can display the results of the search as links to the individual RTF files. What we would like to do is have a button that would concatenate all the RTF into one PDF file for display or print.

Is there a combination of Adobe products that we can get that would allow us to essentially create a PDF on the fly from multiple RTF files? Or do you have recommendation for other solutions/products that can help us achieve this. We already have CF8.

It is my understanding that if we had PDF files instead of RTF, then one can simply use the tag CFPDF to do the concatenation on the fly. However, this is not an option for us. Right now, since there are a ridiculous amount of archived RTFs and constant additions of new ones, it is not piratical to convert all of them to PDF. Furthermore, since RTF is in ASCII, it is easy to store in SQL, do searches on, and move about.

RTF to PDF on the fly?

-RB
TOPICS
Advanced techniques

Views

2.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 17, 2008 Jan 17, 2008

Copy link to clipboard

Copied

Wow, over a month now and still NO REPLY!?

Is there some other forums for CF on the net that actually have enough active users that a response is likely?

-RB

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 20, 2008 Jan 20, 2008

Copy link to clipboard

Copied

Sorry I do not have an answer for you. I think it is a matter of someone that has done this before seeing your question. While I have not, I suspect it may involve java. The closest I have seen is an entry on majix(convert rtf to xml) and ujac (convert to xml to pdf). It may not be the best way to go. I am just throwing it out as a possibility.

You might also ask over at CF-Talk on houseoffusion.com. If you do get an answer, please post back here. I would be interested to know what you end up doing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2008 Jan 21, 2008

Copy link to clipboard

Copied

Thanks for replying cfsearching. At least I don't feel like a lone voice.

I will try your suggestions. Two years (or more?) ago, before Adobe got Allaire, Adobe had an application that would run on one's web server and that would do PDF of various documents on the fly. Our department couldn't afford it then. Now, Adobe doesn't seem to have that application available anymore. We were hoping that they would add the PDF concatenating engine to CF now that they own it.

Oh well! I appreciate the feedback.

-RB

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2008 Jan 21, 2008

Copy link to clipboard

Copied

they do have <cfpdf> tag in cf8 that can do pdf merging...

---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 21, 2008 Jan 21, 2008

Copy link to clipboard

Copied

Well, as Azadi said you can concatenate pdfs easily using cfpdf. Obviously the missing step is getting from rtf to pdf. If you could convert from rtf > html then you could use cfdocument to create the pdfs. But there may be a better way. Now that I think about, you might take a look at LiveCycle. It appears to have this capability http://www.adobe.com/products/livecycle/pdfgenerator/features.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2008 Jan 21, 2008

Copy link to clipboard

Copied

-==cfSearching==- wrote:
> way. Now that I think about, you might take a look at LiveCycle. It appears to
> have this capability
> http://www.adobe.com/products/livecycle/pdfgenerator/features.html

yes i would explore this method as iText (which powers a lot of cf's PDF bits)
currently can't read RTF--though somebody's working on it:

http://www.mail-archive.com/itext-questions@lists.sourceforge.net/msg35283.html

or another trick might be to use POI to parse the RTF.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 22, 2008 Jan 22, 2008

Copy link to clipboard

Copied

PaulH wrote:
> as iText ... currently can't read RTF--though somebody's
> working on it:

Cool. That would be a nice addition to to iText.

> or another trick might be to use POI to parse the RTF.

I was wondering about that. So what format would POI parse it into? ie From RTF > POI (??) > To iText

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 22, 2008 Jan 22, 2008

Copy link to clipboard

Copied

-==cfSearching==- wrote:
> I was wondering about that. So what format would POI parse it into? ie From
> RTF > POI (??) > To iText

i *think* POI will extract just the text. if you need to reproduce the original
formatting you'll need something more heavy-duty which often means commercial.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 24, 2008 Jan 24, 2008

Copy link to clipboard

Copied

PaulH wrote:
> i *think* POI will extract just the text.

Interestingly POI appears to extract text and style information. Though the documentation is a little sketchy in some areas. From what I can tell POI does not support rtf, only ms word doc files. I think javax.swing.text.rtf does though.

Unless you have the time to devote to it, a commercial product is probably the way to go for now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 26, 2008 Jan 26, 2008

Copy link to clipboard

Copied

The new release of itext seems to imply that it can now handle rtf, albeit I have not as of yet tried it.

public class RtfWriter2extends DocWriterThe RtfWriter allows the creation of rtf documents via the iText system Version: $Id: RtfWriter2.java 2996 2007-11-20 22:40:36Z hallm $

from this page

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2008 Jan 26, 2008

Copy link to clipboard

Copied

tojoba wrote:
> The new release of itext seems to imply that it can now handle rtf, albeit I
> have not as of yet tried it.
>
> public class RtfWriter2extends DocWriterThe RtfWriter allows the creation of
> rtf documents via the iText system Version: $Id: RtfWriter2.java 2996
> 2007-11-20 22:40:36Z hallm $

it's pretty much *always* been able to *create* RTF files, this problem is about
reading in RTF & writing the text out as a PDF.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2010 Mar 15, 2010

Copy link to clipboard

Copied

LATEST

Hi,

In my view you may convert each RTF file to PDF in memory and next next merge PDF documents into single PDF:

1. Convert each RTF to PDF in memory

SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();

ArrayList pdfs = new ArrayList();

//1st RTF to PDF

byte[] pdf = p.RtfToPdfConvertByte(rtfString1);

pdfs.Add(pdf);

//2nd RTF to PDF

pdf = p.RtfToPdfConvertByte(rtfString2);

//etc, or you may use loop

pdfs.Add(pdf);

2. Merge several PDF to single PDF on fly

  //merge to single PDF
byte[] singlePDF = p.MergePDF(pdfs);

       
        //show PDF
        if (singlePDF != null)
        {
            Response.Buffer = true;
            Response.Clear();
            Response.ContentType = "application/PDF";
            Response.AppendHeader("content-disposition", "attachment; filename=single.pdf");
            Response.BinaryWrite(singlePDF);
            Response.Flush();
            Response.End();
        }

This code uses the .Net component 'PDF Metamorphosis .Net', so it will also work in CF8.

Best wishes,

Max

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation