Highlighted
Absent Member.
Absent Member.
2444 views

[archive] How to create a PDF file

[Migrated content. Thread originally posted on 19 April 2005]

Good Days,

Searching through the forums, looking for something about my subject i see all the threads say something about to create a virtual printer and then send the data to a pdf file.

?Can i create a pdf file without that virtual printer? maybe there are a external library to create them.

Thanks very much
0 Likes
12 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Yes, there are libraries that do this, but you have to take care of the formatting on your own. You can do this several ways such as directly with the formatting properties provided by the library, or there are some libraries(executables too) that can simply convert text, html and word documents to pdf. There may even be free ones, I just haven't looked for a while. Google is your friend. 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

An often forgotten alternative to pdf is postscript. There is a generic postscript driver in Microsoft Windows, using this with the WIN-SPOOLER-PORT configuration entry, you can have your print redirected to a file which then would be an .EPS.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Dan, can you give a tip to search? I searched before post here but dont see nothing clear. :confused:

Thanks!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Gisle, that's an interesting option because you could then use a free utility like Ghostscript with PS2PDF to convert postcript to PDF. Similiar to what the Adobe Acrobat distiller does.

Article here: http://docs.linux.com/article.pl?sid=04/03/25/1650210&tid=39&tid=14

Ghostscript overview here: http://www.cs.wisc.edu/~ghost/doc/AFPL/6.50/Readme.htm
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Hi,

we have written a dll, which can create PDF-files from standard cobol-printfiles or directly from an application. Therfore you have to sae all lines of a page in an buffer and send this buffer to the DLL. With this DLL you can set background images, fonts, pageformats and so on. A detailled description will also be available. This DLL only works on Windows systems.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

We used an ActiveX control from ComponentOne in their VSVIEW product.

VSVIEW contains a VSPrinter control, which you would need to use to output the report and you can then render the output to a PDF using their VSPdf control. The VSPrinter control works like the VB Printer object and provides drawing, font control, print preview, etc.

We do not actually use the VSPrinter control do printing to printers - when we want to output a report in PDF, we write it to a text file, then we have a program that reads the text file and sends the lines to the VSPrinter control, then renders it to the PDF using the VSPdf control.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Hi JoeD,

I've been looking for a tool to do this stuff from AcuCobol, so I've had a brief look at the ComponentOne and it interesting.

Do you have an AcuCobol example you could mail me ?

sb@lessor.dk

Thanks !
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

I'm sorry but I don't have a good example because I accomplished it in a roundabout way. At the time we started using it, native ActiveX support was not available in the runtime so we wrote the report to a text file then called a VB program that read the file and fed it to the ComponentOne control to generate the PDF.

It would be more efficient if it were rewritten to use the control directly, but there was never any time for a rewrite...
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Depending on how much control you need/want, I have a perl script that uses the PDF::API2 module (available on CPAN) that I open a pipe to to create PDF's files programattically on the fly.

The interface may be a little more low level than you are looking for, but it gives pretty good flexibility. If you are interested I could post it or send it to you.

Steve
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

Steve,

I would very much like to see how you do this.

Thanks in advance.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] How to create a PDF file

I've attached a zip with a test program, the pdf it creates, and the perl script used. You'll probably have to tweak things (font path?, put the .pl in your path, ... etc). I'll apologize now ... the program does some awkward things (much of it is a port from our previous cobol, and our setup has oddities) but hopefully it shows the concept well enough. I tested it real quick under linux and Win32.

Also the script is written around the .3r77 version of PDF::API2, and is not compatible with the .4+ versions. Should be easy enough to modify for the newer versions, I just haven't had a reason to yet. You can get .3r77 at http://pdfapi2.sourceforge.net/


-Steve
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.