Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
modifying existing pdfs?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stefan Schmiedl  
View profile  
 More options May 1 2002, 5:30 am
Newsgroups: comp.lang.lisp
From: Stefan Schmiedl <s...@xss.de>
Date: 1 May 2002 09:30:40 GMT
Local: Wed, May 1 2002 5:30 am
Subject: [cl-pdf] modifying existing pdfs?
Greetings.

Marc's CL-PDF is great for producing new PDF documents in CL,
and I intend to use it to create a high quality background
image for invoice forms generated by some other program, whose
programmers claim that "background images can't be done in our
PDF printer".

Right now, I think I would need to (roughly) parse the contents
of the generated PDF into a page tree, find the (stream) contents
of each page, slap the image in front of it (should be doable by
referencing it, I need to look this up), regenerate the administrative
stuff and write the file out again.

Or maybe the other way round: generate the required number of
pages with background picture with CL-PDF and insert the generated
(stream and resource) data. Then CL-PDF would do the housekeeping
for me.

That's the background, now for the questions:

1. Does something like this already exist?

2. If not, does anybody have any hints on creating a PDF parser?

And just for the fun of it:

3. Try finding the language reference for PDF via a search engine.
   Hint: "PDF reference", "PDF language reference", "Adobe PDF format
   description", "PDF developer documentation" are not very helpful :-)

   I *have* found it (pdf and zipped pdf) on
   http://partners.adobe.com/asn/developer/acrosdk/docs.html
   but I wonder, if there might be more elegant way than
   the wild guesswork and grasping at straws that I used.

Thanks,
s.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Battyani  
View profile  
 More options May 1 2002, 7:55 am
Newsgroups: comp.lang.lisp
From: "Marc Battyani" <Marc.Batty...@fractalconcept.com>
Date: Wed, 1 May 2002 13:52:06 +0200
Local: Wed, May 1 2002 7:52 am
Subject: Re: [cl-pdf] modifying existing pdfs?

"Stefan Schmiedl" <s...@xss.de> wrote

> Marc's CL-PDF is great for producing new PDF documents in CL,
> and I intend to use it to create a high quality background
> image for invoice forms generated by some other program, whose
> programmers claim that "background images can't be done in our
> PDF printer".

> Right now, I think I would need to (roughly) parse the contents
> of the generated PDF into a page tree, find the (stream) contents
> of each page, slap the image in front of it (should be doable by
> referencing it, I need to look this up), regenerate the administrative
> stuff and write the file out again.

The easiest way to do this is to parse the PDF file and recreate the
structure with CL-PDF objects. Then you can modify it add/remove pages, add
content before/after the existing pages content and then have CL-PDF write
the new PDF file.
I do this on a web site and generate the PDF files in memory to serve HTTP
requests. The background PDF is a word generated document (i.e. ugly PDF!)

> Or maybe the other way round: generate the required number of
> pages with background picture with CL-PDF and insert the generated
> (stream and resource) data. Then CL-PDF would do the housekeeping
> for me.

If you generate the background with CL-PDF, then it's much easier to stay in
CL and to add content to a page. In fact if you just have a background
content (PDF stream) you can insert it in any page you want by doing
something like this in the (with-page ...):
(write-sequence *existing-pdf-stream* *page-stream*)

> That's the background, now for the questions:

> 1. Does something like this already exist?

> 2. If not, does anybody have any hints on creating a PDF parser?

Marc

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Schmiedl  
View profile  
 More options May 1 2002, 10:10 am
Newsgroups: comp.lang.lisp
From: Stefan Schmiedl <s...@xss.de>
Date: 1 May 2002 14:10:25 GMT
Local: Wed, May 1 2002 10:10 am
Subject: Re: [cl-pdf] modifying existing pdfs?
On Wed, 1 May 2002 13:52:06 +0200,

Marc Battyani <Marc.Batty...@fractalconcept.com> wrote:
> The easiest way to do this is to parse the PDF file and recreate the
> structure with CL-PDF objects. Then you can modify it add/remove pages, add
> content before/after the existing pages content and then have CL-PDF write
> the new PDF file.
> I do this on a web site and generate the PDF files in memory to serve HTTP
> requests. The background PDF is a word generated document (i.e. ugly PDF!)

maybe as bad as Word-generated HTML?? ugh.

>> Or maybe the other way round: generate the required number of
>> pages with background picture with CL-PDF and insert the generated
>> (stream and resource) data. Then CL-PDF would do the housekeeping
>> for me.

> If you generate the background with CL-PDF, then it's much easier to stay in
> CL and to add content to a page. In fact if you just have a background
> content (PDF stream) you can insert it in any page you want by doing
> something like this in the (with-page ...):
> (write-sequence *existing-pdf-stream* *page-stream*)

So let's write a PDF parser returning CL-PDF objects.
Would you be interested in merging this back to your stuff?
If so, do you have any strategic tips regarding package layout etc.?

thanks.
s.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Battyani  
View profile  
 More options May 1 2002, 11:21 am
Newsgroups: comp.lang.lisp
From: "Marc Battyani" <Marc.Batty...@fractalconcept.com>
Date: Wed, 1 May 2002 17:19:09 +0200
Local: Wed, May 1 2002 11:19 am
Subject: Re: [cl-pdf] modifying existing pdfs?

"Stefan Schmiedl" <s...@xss.de> wrote

> So let's write a PDF parser returning CL-PDF objects.
> Would you be interested in merging this back to your stuff?
> If so, do you have any strategic tips regarding package layout etc.?

I already have a pdf parser which constructs a cl-pdf document from a pdf
file but I didn't released it because :
    1- it's a quick and dirty hack
    2- it's not portable as I use the Lispworks's parser generator

I don't have the time to clean it and make it portable by either writing a
stand alone parser for the pdf grammar or using a portable parser generator
like zebu. For the lexer, it could be a good idea to look at Michael
Parker's lexer generator instead of my hand written one.

If you have some time and are willing to work on this just contact me...

Marc

.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »