Page 1 of 1

Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 10:25 am
by John
My picture is coming out humongous. I'm printing the same images that I had no control over print size in VB6, but they're just all stretched and huge. each pixel is approximately 15 mm wide. and maybe 5 mm tall. even a small image startup.bmp grows way off the page. And logos that I've been printing in VB6 are similarly stretched out of shape. Does anyone have any ideas?

Re: Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 10:32 am
by Gabriel
When you generate PDFs with BR, what you're really doing is called Native Windows Printing.

Therefore any NWP command will work.

Check out the picture NWP command. It allows you to print a picture and specify your size in either Inches, Row/Cols, or Decipos'.

This page will show you the command and its substitue if you were using printer.sys. We reference this page here to see what the raw NWP command is, because I'm going to assume you are not using printer.sys.

http://brwiki2.brulescorp.com/index.php ... ictures.2A

From this page, we can see the raw NWP command is this:

[ESC]picture='1,1,logo.jpg'

So if you put that in a string to print, do something like this:

1) Position your cursor to where you want the picture to be.
2) PRINT #255: CHR$(27)&"picture='2,2,logo.jpg'"

(Note the single quotes that appear around the picture size and file name.)

Gabriel

Re: Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 10:59 am
by John
THANK YOU! I now understand what I was doing wrong! I was thinking the x and y were the coordionates on the page where the top left corner should be positioned. It seems so obvious now. Doh :oops:

Re: Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 11:07 am
by Gabriel
:) I hope i wasn't over-explaining too much. I just figured I should over-explain in case anyone is searching for this information in the future.

Gabriel

Re: Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 2:10 pm
by John
:D not at all. :?: How do I specify which I want to measure my picture in decipos? Currently my command looks something like:

Code: Select all

\Epicture='2,2,r:\acsub\logo_x.jpg'
It seems to be specifying it in inches. All my other measurments are in decipos. Well mm actually but I convert from mm to decipos for all the rest.

Re: Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 3:48 pm
by John
I just did this:

64280 imgWidth=imgWidth/720*28.346456692
64300 imgHeight=imgHeight/720*28.346456692

that converts them to mm. And BR NWP/PDF stuff doesn't seem to mind the 9 decimal places I've been throwing at it.

Re: Specifying Image sizes in PDFs

Posted: Wed Dec 14, 2016 3:55 pm
by Gabriel
Sorry, I may have been wrong. Maybe pictures can only be specified in Inches. Go America! Woot!

Anyway, I'm glad you got it working. Yeah in this case, sounds like the correct solution is to convert it using a calculation like you did.

Gabriel