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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating my own PDF

Status
Not open for further replies.

roberthpike

Programmer
Dec 15, 2004
17
CA
Got a Perl script I created but I get errors trying to open PDF documents generated from this script. Anyone out there knowledgable in creating PDFs from code? If so, could someone take a look at the PDF I generated? Thanks in advance for any help.

roberthpike@yahoo.com
Rob
 
Hey UnixJunky,
I appreciate the response but I was hoping to resolve the problem(s) I was having with my own script. I've been looking it over too long to be going to someone else's script right now and I'm not the kind to just give in. Besides I'm damn curious to why it isn't working. Are you able to give me additional suggestions on what might be wrong or possibly point out what's wrong with the PDFs I've generated? I'd appreciate any helpful advice. Thanks.

Rob
 
Robert
Where's your code that you wanna somebuddy else take a look at it ?
 
Hi Rob, submit your code on here and we'll take a look at it, I assume you are using the module that UnixJunky suggested? It's probably the same module I would use as well. Also some guide as to the environment you are working in would be useful as there may be other options.


Rob Waite
 
Hi Guys,
Thanks for the response. It actually wasn't the perl script code I was referring to cause I figured that might take someone a bit longer to look through. I was referring to the generated PDF document I created. When you say post do you want me to just post it in the body of a message? I was told by another user in another forum that you could upload the file on this site and then other users could download. Is that the case?
Answering your question waiterm: no I'm using my own standalone module that I created. I wanted to get a feel of creating PDFs on my own so that later I could have more control over what I wanted. Plus the module suggested may be great but I need to eventually convert this script into other languages (i.e. lower level languages in particular).
Just let me know where you'd like me to post or send the file and I'll accommodate. Thanks so much for the responses guys.

Rob
 
Heres the PDF document's contents. This PDF gives me a warning that the file was damaged and is being repaired (the blank line below was added to separate the message here and the content only).

%PDF-1.4
1 0 obj
<<
/Type /Catalog
/Pages 3 0 R
/Outlines 2 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Kids [4 0 R]
/Count 1
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/MediaBox [ 0 0 612 792 ]
/Contents 5 0 R
/Resources <<
/ProcSet 6 0 R
/Font <</F1 7 0 R>>
>>
>>
endobj
5 0 obj
<<
/Length 36
>>
stream
BT
/F1 10 Tf
100 100 Td
1 0 0 1 20 770 Tm
(Just a test of the PDF Line Acceptance) Tj
ET
endstream
endobj
6 0 obj
[/PDF /Text]
endobj
7 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Courier
/FirstChar 0
/LastChar 255
>>
endobj
xref
0 8
0000000000 65535 f
0000000010 00000 n
0000000082 00000 n
0000000134 00000 n
0000000198 00000 n
0000000351 00000 n
0000000502 00000 n
0000000533 00000 n
trailer
<<
/Size 8
/Root 1 0 R
>>
startxref
648
%%EOF
 
Is there any reason why you don't want to use the standard module recommended by UnixJunky?

If you are going to re-invent the wheel, it's important not to come up with a square one...
 
1. I have worked on this for awhile and I would very much like to see what is the problem(s).
2. I have very specific requirements that this module does not have plus I need to port this module over to another language and some parts of the module I don't really need.
3. I need some features not in this module and in order to add more functions I need to understand the problems I have encountered using the program I have before stepping farther. Instead of starting with a much larger, more complex module which has more features than I'm looking for, I would like to find the small problem in my script, fix it, and continue adding the things I need in modular steps.

Do you have any helpful suggestions why the script is not working? I'm not trying to re-invent the wheel but rather trying to understand the problems encountered at a more basic level before stepping into something more complex whereby no one will be able to answer an questions. Not sure why the second statement.

Rob
 
FYI, PDF::API2 is another good Perl module for creating PDF's.

Unfortunately as this is a Perl forum, you may not get much help here on PDF syntax.

 
Philote,
Do you know if this API can add watermarks or not?
Rob
 
I'd try adobe support, if you can't find someone to help here.

or have a quick gander at a few of the adobe groups here

--Paul

cigless ...
 
Well, you can put graphics into your documents, so I bet you could work something out. The only problem is that the documentation for PDF::API2 is very poor.

Here's a link to a tutorial I used to get myself going:
It's not finished so the part where it includes a graphic is just code with no explanation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top