PDF FontSize and Option 68

Discussion about printing issues and techniques.

Moderators: Susan Smith, admin, Gabriel

Post Reply
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

PDF FontSize and Option 68

Post by John »

In my PDF creation I found my fontsizes were not being respected horizontally only vertically and found that option 68 should fix that for me, however when I use Option 68 my fontsizes are ignored completely. Am I missing something? Has anyone else had this issue?
John Bowman
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: PDF FontSize and Option 68

Post by Gabriel »

You might be having a problem with Proportional Spacing .. When using NWP you have to set PS to off if you want to print any non-proportional fonts. Font Size will be affected if your PS setting is wrong.

Specify [PS] or [/PS] to turn it on or off if you're using printer.sys substitutions. And remember, if you're not using printer.sys you can always just look up the command in printer.sys to find out what it is, and then specify it directly in your code.

Gabriel
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: PDF FontSize and Option 68

Post by John »

It seems good thinking but [PDF] does not have a substitute for [PS] or [/PS] in pdf.sys like PCL does in printer.sys.
John Bowman
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: PDF FontSize and Option 68

Post by Gabriel »

John,

You must be talking about the CLS printer.cls -- that is completely different then printer.sys.

The real printer.sys does not have a section for PDF at all. You don't need one.


BR's built in PDF functionality uses NWP. So let me say again, for PDF printing in BR you use PCL or NWP codes.

Gabriel
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: PDF FontSize and Option 68

Post by Gabriel »

Remember you're really just using NWP. You do not need to worry about PDF at all -- you just print ANY NWP report and BR handles the rest, putting it in a PDF file for you.
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: PDF FontSize and Option 68

Post by John »

I tried adding the "\E(s0P" (where \E is chr$(27)) from the printer.sys line that shows:

Code: Select all

 Printer PCL [/PS], "\E(s0P" ! Cancel Proportional Spacing
To the top of my page, right after the page size is set but it did not affect the proportional spacing that I want to prevent.
John Bowman
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: PDF FontSize and Option 68

Post by John »

Okay - thanks to some help from Gordon - I've figured out what my problem was. For starters I was using Fixed Width Fonts and expecting Option 68 to change their spacing. Of course, it does not.

For Fixed Width Fonts you need to specify both the height and the width. Since I am converting functions that call a VB6 print routine to call BR PDF routine I needed a bit of automatic translation. Here's what I came up with (in pseudo-code):

Code: Select all

If it is a fixed width font then
  cpi=24-fontsize
  pr #255: esc$&'(s'&str$(cpi)&'H'
  fontsizeHeight=fontsize/1.11
  pr #255: esc$&'(s'&str$(fontsizeHeight)&'V'
else
  pr #255: esc$&'(s'&str$(fontsize)&'V'
end if
The adjustments may not be exact, - I may end up tweaking them more later - but they are pretty close.
John Bowman
Post Reply