Hi,
There are libs, in Pascal, to convert .doc and/or .html files to .pdf?
Marcos Douglas

Mailing lists / fpc-pascal / 2011-01
12 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
There are libs, in Pascal, to convert .doc and/or .html files to .pdf?
Marcos Douglas
Marcos Douglas wroteHi, There are libs, in Pascal, to convert .doc and/or .html files to .pdf?
I don't think so, but I would suggest to use a headless OpenOffice.org/LibreOffice for the conversion. Using the Pascal UNO Bridge you may even be able to control it from a Pascal application, but for a simple conversion it's probably a lot easier to just invoke it via commandline.
You're right. The command line is more simple.
Thanks for the tip, I will try this.
Marcos Douglas
I have not found
I'm looking in http://api.openoffice.org/
Is it mandatory use UNO bindings?
I want do the same of this project http://html2pdf.fr/
Marcos Douglas
Another solution is that you could start a generic library for handling formatted text documents. It will certainly be harder, and take more time, but the end result will be much better and it won't require having OpenOffice installed (a rather huge thing to have as a dependency).
We already have a spreadsheet library:
http://wiki.lazarus.freepascal.org/FPSpreadsheet
Something similar could be done for handling the class of formatted documents, like pdf, doc, html, etc.
FPVectorial has support for PDF reading, but only from a vectorial drawing point of view, nevertheless it's code and documentation which explain the PDF format could be reused. I actually have documentation in portuguese about the PDF format.
http://wiki.lazarus.freepascal.org/fpvectorial
Yes, that is a better solution for the future... unfortunately I have not time so much to make this software. The plataform is Windows and old ASP to make sites. I have to make a component to ASP call to make this convert, HTML to PDF.
If exists a C lib, eg, facilitate my work.
Marcos Douglas
I have not found I'm looking in http://api.openoffice.org/ Is it mandatory use UNO…
Marcos Douglas wrote> You're right. The command line is more simple. > Thanks for the tip, I will try this. I have not found
Since you also mentioned that you need to access it from ASP, I guess that one might offer you the most flexibility:
http://www.artofsolving.com/opensource/jodconverter
... because you can run it as webservice. Or you can simply invoke it from commandline.
Yes, I think is easy to use. Thanks, I will see on next Monday, at work.
Marcos Douglas
Since you also mentioned that you need to access it from ASP, I guess that one might…
Interesting, I have been looking for some way to convert a large number of Word documents to PDF in some automated way without using MS Office, because as far as I have seen it would have to be done manually by printing to a PDF printer.
The company I work for has a system for writing up purchase specifications for all the parts we use as standardized documents in Word format. There are literally thousands of these.
The problem is that in order to read them one must have an instance of MSOffice installed and it sometimes takes a long time to open each document too. So I have been on the lookout for some way to implement a program for converting these to PDF.
As an example all our drawings are stored for access by production in PDF format, which is very simple to use (and quick if one refrains from using the Adobe reader).
And now this thread appears here that is very similar to what I need. If a Lazarus/FPC implementation is created, possibly using the OpenOffice hook described here, I would be very much interested too!
The link above goes in the end to a download of *compiled* java code so it is not that good for me. An FPC implementation would be really useful though.
Right, after I wrote my message I realized I had a WinXP virtual machine with OpenOffice 3.2 installed, so I downloaded the converter and tested it using the manual command line commands.
It worked OK to convert a 2-page test document. :-)
I have a question in this context, tha you might answer: In the description you are directed to starting OpenOffice.org in headless mode as a socket server. Then the Java application can connect to it and make the conversion.
But what is NOT specified is how you get rid of the headless running OpenOffice application...
I don't want it running after I am done with my conversion. Is there a way except through TaskManager (provided it only loads the two files exe and bin)???
A will heed your advice concerning the coding and not dive in due to the complexity. Will instead try to utilize the java function via a TProcess object such that I can manage the files that are to be converted.
*That* shouldn't be too difficult to do in Lazarus/FPC...
On Fri, 28 Jan 2011 22:27:17 +0100, Andreas Schneider Interesting, I have been looking…
Hello Bo,
Sunday, January 30, 2011, 9:46:22 AM, you wrote:
BB> The problem is that in order to read them one must have an instance of BB> MSOffice installed and it sometimes takes a long time to open each BB> document too. So I have been on the lookout for some way to implement BB> a program for converting these to PDF.
BB> As an example all our drawings are stored for access by production in BB> PDF format, which is very simple to use (and quick if one refrains BB> from using the Adobe reader).
BB> And now this thread appears here that is very similar to what I need. BB> If a Lazarus/FPC implementation is created, possibly using the BB> OpenOffice hook described here, I would be very much interested too!
I had done this in Delphi in the past years using the Adobe Reader 5 OCX and a Virtual PDF Printer. Maybe I have the code somewhere.
On Fri, 28 Jan 2011 22:27:17 +0100, Andreas Schneider Interesting, I have been looking…
Hello Bo,
Sunday, January 30, 2011, 9:46:22 AM, you wrote:
BB> And now this thread appears here that is very similar to what I need. BB> If a Lazarus/FPC implementation is created, possibly using the BB> OpenOffice hook described here, I would be very much interested too!
Please, forget my last post... I completly missunderstood the idea. My apologizes.