Welcome Guest, Not a member yet? Register   Sign In
.rtf to .pdf Conversion
#1

[eluser]Peham[/eluser]
Hi,

I am working on a project which takes user input and put the user data in to an .rtf file by replacing placeholders, now i have to generate the pdf file from .rtf file.
I am searching for a solution for that, tried tcpdf but the size of my .rtf file is almost 1.6 mb, and it gives error.
Please let me know, If there is any other solution you guys know.
#2

[eluser]TheFuzzy0ne[/eluser]
This might help. http://stackoverflow.com/questions/20190...mat-to-pdf

Short of writing something to do it yourself, I doubt you'll find a pure PHP solution. Is there any reason why it has to be a PDF? Can't you use a PDF printer on your PC to print the RTF file to PDF?
#3

[eluser]Peham[/eluser]
Hi,

The client wants the final file to be in pdf and to be sent via email. It is one of the requirements that the file should not loose its spacing, margins, styles etc after the file conversion. I concern that the intermediate way could break the alignments of the document.
Well i must try this way. I'll be posting in the forums if I don't get it working.
I found this library http://www.hotscripts.com/listing/phprtf-lite/ but they website has been removed.
Kindly let me know if you guys could find any other solution.
#4

[eluser]TheFuzzy0ne[/eluser]
I think there's a reason this task isn't commonly performed on a Web server. Does your client realise this will consume considerable server resources? I doubt you'll be able to convert an RTF document to PDF with as much accuracy as you think. I'm pretty sure it would need to be converted to HTML first, in order to ensure that the PDF generator get's the margins and spacing right, but converting RTF to HTML, is where I suspect you'll come undone.

Here are some links that may help you with converting HTML to PDF.
http://www.tufat.com/s_html2ps_html2pdf.htm
http://code.google.com/p/wkhtmltopdf/
http://html2pdf.fr/en/example
http://code.google.com/p/dompdf/

However, these are really only designed for smaller documents. With a 1.6MB document, your mileage may vary...

Here's a paid-for solution:
http://docraptor.com/
#5

[eluser]Peham[/eluser]
Hi,

I have been hitting my head with many libraries and api's now. I have found an api to get the work done, following is the link to it.
http://www.doxument.com
http://code.google.com/p/doxument/
I couldn't figure out the way to make this api working yet. I'll let you guys know if get it working. Meanwhile any help from your side would be greatly appreciated.
#6

[eluser]hebe_210[/eluser]
Thx for sharing




Theme © iAndrew 2016 - Forum software by © MyBB