Specifying Image sizes in PDFs

Discussion about printing issues and techniques.

Moderators: Susan Smith, admin, Gabriel

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

Specifying Image sizes in PDFs

Post 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?
John Bowman
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: Specifying Image sizes in PDFs

Post 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
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: Specifying Image sizes in PDFs

Post 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:
John Bowman
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: Specifying Image sizes in PDFs

Post 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
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: Specifying Image sizes in PDFs

Post 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.
John Bowman
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: Specifying Image sizes in PDFs

Post 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.
John Bowman
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: Specifying Image sizes in PDFs

Post 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
Post Reply