Page 1 of 1

PDF FontSize and Option 68

Posted: Tue Nov 22, 2016 8:45 am
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?

Re: PDF FontSize and Option 68

Posted: Tue Nov 22, 2016 11:20 am
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

Re: PDF FontSize and Option 68

Posted: Tue Nov 22, 2016 11:45 am
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.

Re: PDF FontSize and Option 68

Posted: Tue Nov 22, 2016 12:09 pm
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

Re: PDF FontSize and Option 68

Posted: Tue Nov 22, 2016 12:10 pm
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.

Re: PDF FontSize and Option 68

Posted: Tue Nov 22, 2016 3:20 pm
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.

Re: PDF FontSize and Option 68

Posted: Tue Dec 13, 2016 8:34 am
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.