-
1. Re: Multiple RTF to one PDF on the Fly
RB_from_TX Jan 17, 2008 3:49 PM (in response to RB_from_TX)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 -
2. Re: Multiple RTF to one PDF on the Fly
-==cfSearching==- Jan 20, 2008 10:37 PM (in response to RB_from_TX)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. -
3. Re: Multiple RTF to one PDF on the Fly
RB_from_TX Jan 21, 2008 6:06 PM (in response to -==cfSearching==-)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
-
4. Re: Multiple RTF to one PDF on the Fly
Newsgroup_User Jan 21, 2008 6:18 PM (in response to -==cfSearching==-)they do have <cfpdf> tag in cf8 that can do pdf merging...
---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com -
5. Re: Multiple RTF to one PDF on the Fly
-==cfSearching==- Jan 21, 2008 7:06 PM (in response to Newsgroup_User)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
-
6. Re: Multiple RTF to one PDF on the Fly
Newsgroup_User Jan 21, 2008 8:04 PM (in response to Newsgroup_User)-==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. -
7. Re: Multiple RTF to one PDF on the Fly
-==cfSearching==- Jan 22, 2008 5:09 PM (in response to RB_from_TX)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 -
8. Re: Multiple RTF to one PDF on the Fly
Newsgroup_User Jan 22, 2008 9:52 PM (in response to RB_from_TX)-==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.
-
9. Re: Multiple RTF to one PDF on the Fly
-==cfSearching==- Jan 24, 2008 11:58 PM (in response to Newsgroup_User)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. -
10. Re: Multiple RTF to one PDF on the Fly
tojoba Jan 26, 2008 2:38 PM (in response to RB_from_TX)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 -
11. Re: Multiple RTF to one PDF on the Fly
Newsgroup_User Jan 26, 2008 10:11 PM (in response to RB_from_TX)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. -
12. Re: Multiple RTF to one PDF on the Fly
SautinSoft Mar 15, 2010 10:05 PM (in response to RB_from_TX)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