🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.postscript.programming
4 messages
4 total messages Started by RobertSpicer Fri, 20 Oct 2006 18:36
Adding characters to font definition array
#271
Author: RobertSpicer
Date: Fri, 20 Oct 2006 18:36
46 lines
1946 bytes
I'm really new to PostScript, but think this would provide a perfect option for my project. I have 300,000+ IRS year end tax forms that I need to generate as either .tif or .pdf files for eventual committal to an imaging system. The original forms are being produced by a vendor, and they are supplying me with an XML file which I intend to use as a 'mailmerge' source. I have a sample image template with dummy information related to the recipient, received in PDF format which I've saved as a PostScript file.

I can recreate the .ps file and insert my recipient-specific data. However, I've noticed that not all of my characters are being output. I believe that this is related to the Font Definition routine. Sample below...

/FontName /N692 def
/FontMatrix [1
0
0
1
0
0 ]def
/FontBBox [0
-7
20
26 ]def
/Encoding [
32 nND
/c20
15 nND
/c30
1 nND
/c32 /c33
1 nND
/c35
1 nND
/c37 /c38
8 nND
/c41 /c42 /c43 /c44 /c45
1 nND
/c47
1 nND
/c49
2 nND
/c4C /c4D /c4E /c4F
2 nND
/c52 /c53
2 nND
/c56
2 nND
/c59
166 nND] def

I'd like to be able to modify this (and other fonts contained within the file) so that all alphanumeric characters are accounted for. I've tried adding the appropriate hex values (/c46 for the letter 'F') but then end up with errors when attempting to distill to pdf. Any help would be greatly appreciated.

Thanks,
Robert
Re: Adding characters to font definition array
#272
Author: RobertSpicer
Date: Fri, 20 Oct 2006 21:35
24 lines
1671 bytes
Okay - I'm making some headway...I've now been able to add more characers to the array. New problem: How might I determine the appropriate values to the current dictionary? I've attempted to copy/paste a similar character, changing the reference from '/c20' to '/c21' as an example. However, the actual appearance of /c21 is the same as /c20.

I have a feeling its somewhere within this string...

1 dict begin /_i 0 def currentdict end mark exch { begin {
<~s8W-!s8W-!~>

and that I would need to change the values for the desired output character accordingly within the < > range. How might I determine the appropriate values?

/c20 {
12 0 setcharwidth
q
3.0 0.0 0.0 8.0 0.0 -1.0 cm
q
n
0.0 0.0 1.0 1.0 re
<< /ImageType 1 /Width 3 /Height 8 /ImageMatrix [3.0 0.0 0.0 -8.0 0.0 8.0] /BitsPerComponent 1 /Decode [0.0 1.0 ] /DataSource 1 dict begin /_i 0 def currentdict end mark exch { begin { <~s8W-!s8W-!~>
} _i 1 eq{ /_i 0 def pop ()}{_i get /_i _i 1 add def} ifelse
end } bind aload pop ] cvx
 >>
imagemask
Q
Q
} bind def
Re: Adding characters to font definition array
#273
Author: Helge_Blischke
Date: Sun, 22 Oct 2006 11:04
9 lines
1382 bytes
Well, you are obviously creating your PS template from a PDF template whichg has been made up using a(some) bitmapped Type 3 font(s). From that, you'll hardly have any chance to add glyphs for the additional characters you need.

Try to edit your PDF (using Acrobat Professional) and modify all text using a "well formed" font, for ease of use I'd suggest Type1.

Well, speculating more on what you intend to do - why not use a tool like Thomas Merz's pdflib (which is available for various platforms for a reasonalbe price)?

Perhaps you could pst (an URL to) sample files and describe with mre detail what you are going to do. It may be possible that the best way is to write a PostScript program (yes, PostScript is a programming language) from scratch.

Helge
Re: Adding characters to font definition array
#274
Author: Alex_Cherepanov
Date: Mon, 23 Oct 2006 15:01
17 lines
1439 bytes
RobertSpicer@adobeforums.com wrote:
> I have 300,000+ IRS year end tax forms that I need to generate as either .tif or .pdf
Assuming 1 second per file it takes 3+ days of CPU time.

> Original forms are being produced by a vendor, and they are supplying me with an XML
There are many ways to solve the problem. Being a PostScript programmer, 
  I'd parse the XML file in PostScript and generate the required graphic
output directly.

The PostScript program can be run on Ghostscript PostScript interpreter
and produce PDF, TIFF, and a number of other graphic formats.

You can contact me off-list if you need some practical help.

Regards,
Alex Cherepanov
alexcher@quadnet.net
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads