Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File cannot be opened error

Status
Not open for further replies.

j53h

Technical User
Jun 27, 2006
5
US
I created a "printer" port to allow me to create pdf type files, by using Ghostscript and RedMon. When I print to this printer via Word or any editor, a pdf file is created and I can open and read it using Adobe Acrobat 7.0. Works great.

But, when I print to it from a Cobol program or by using the Dos print command, a pdf file is created that I cannot read. I get this message from Adobe Reader " There was an error opening this document. This file cannot be opened because it has no pages.
 
I don't know of any way to print pdfs from COBOL or DOS. Can you post the code are you using? Obviously it isn't writing any data...

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
No special Cobol code, just was trying to print to the printer that was setup as a pdf port the same way that I would print to any other printer.

It is my understanding that there is a PDF program that will work with Cobol, but it is not cheap and I was testing my other options first.

If it helps, I opened the test pdf file using an editor and here are the contents.
____________________________________
%PDF-1.3
%Çì?¢
3 0 obj
<< /Type /Pages /Kids [
] /Count 0
>>
endobj
1 0 obj
<</Type /Catalog /Pages 3 0 R
>>
endobj
2 0 obj
<</Producer(AFPL Ghostscript 8.0)
/CreationDate(D:20080625095220)
/ModDate(D:20080625095220)>>endobj
xref
0 4
0000000000 65535 f
0000000068 00000 n
0000000116 00000 n
0000000015 00000 n
trailer
<< /Size 4 /Root 1 0 R /Info 2 0 R
>>
startxref
225
%%EOF
____________________________________
 
MS Word supports pdf file creation in its later versions (as does MS Office). The only option I can think of is to purchase pdf writer (usually under $300) and install it with the other printers on your PC.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top