Same image multiple times in one document
Hi there,
I'm a software developer, and currently the system I'm working on produces postscript documents for invoices/orders etc. and I'm looking for a way to reduce the size of the postscript file. One simply way would be to re-use the same image (company logo, for example), rather than specifying it again for every page.
The images are produced using the linux tool ps2pdf - the output is then chopped up so it literally only has the image producing code, and then dumped as-is into the document where the image is required. What I'd like to do is put this postscript image into a procedure, then call it with the height, width, x and y position whenever I need it. Doing this will drastically reduce down the PS file from MB sizes to KB sizes.
This is an example of how the documents are currently produced: Postscript multiple images - Pastebin.com
This is an example of what I thought would work, with the image inside a procedure: Postscript multiple images - with procedure - Pastebin.com
(These aren't actually real documents, just an example of how it works!)
Can anyone help me to get the second example working? Essentially, I copied the image producing code into a procedure, and then I'm trying to call it. No matter what I try, it doesn't want to play - the error I'm getting in Ghostscript is "/syntaxerror in --%ztokenexec_continue--". What I can find on the web about this error doesn't help - I'm not particularly experienced with postscript, so please be nice!
Thanks in advance!
John
