Graphics formats in printed reports

Hey I’ve got a report my software prints. It reads in a .PNG or .JPEG logo for the cover page.
This usually works fine but now I have to do it for a logo that is just one big text name
in serif font so when you print it’s all jaggedy,

The company sent me an EPS file which is vector so I sized it to 300dpi at the exact size
the report needs and exported as JPEG at the maximum size 10. Also tried PNG.
Both appear a bit blurry on screen in print preview and when I print it.

Bottomline: the Client doesn’t like it.

I have done this for about 40 other companies that use our software and have not had anyone complain.
But I think the issue is their logo style which is very finely detailed and the loss of quality cannot be hidden
by the eye or something.

On this documentation page for Picture:
http://documentation.xojo.com/index.php/Picture
It does not say what formats are supported that I can find.

I’m wondering if some other format would work better. TIFF? I doubt EPS would be a supported format
although I could test it.

Just wanted to see if anyone had any advice before I spend hours doing manual trial and error testing.

Are you sure you printer is also at 300dpi?
and what ever command is inserting the graphic is not attempting to resize it even slightly?

what does

mean?

Take the EPS file and size it to the exact size at 1200dpi into a PNG or picture
Then .drawpicture the result into the available space on your printer graphic.
It will be smooth enough

I’ve used PNG format to print at high quality on a printer, and it worked fine.
the png must be at the resolution of the printer.
pdf does not work, tiff is ok but you have to deal with huge files sizes

Yes. Client’s printer is too and they think it’s too blurry/fuzzy/jaggedy.

Size it to the correct size and the export it out to PNG?
I did this at 600 dpi and it made no difference. I can try 1200 dpi and see if it helps.

[quote=326996:@Jean-Yves Pochez]I’ve used PNG format to print at high quality on a printer, and it worked fine.
the png must be at the resolution of the printer.[/quote]

I have tried 300dpi PNG at a size that places it onto the report at the size we need.
Still blurry. Jeff is recommending trying a higher resolution

The code reads in the file and assigns it to a picture variable. It does not resize it at all but I will go into the dev env and DOUBLE CHECK the code to make sure it is not passing something to resize the incoming image.

[quote=326989:@Jeff Tullin]Take the EPS file and size it to the exact size at 1200dpi into a PNG or picture
Then .drawpicture the result into the available space on your printer graphic.
It will be smooth enough[/quote]

Can I read the EPS file directly or only PNG? i.e. does Xojo Picture.Open support opening EPS format files?

I don’t see that in the documentation so assume its not supported. Especially since it’s vector.

You can only read PNG

Lets say you want the logo to occupy 3 inches by 1 inch of a page that is output at 300 dpi
Create a picture of 3 x 1200 by 1 x 1200 pixels

eg 3600 x 1200 pixels in size
Open the EPS file, and paste the logo to occupy the whole picture.

Open the printer at 300 dpi.
A page of A4 will give you roughly 8.5 x 300 pixels to use across the page.
3 inches of that is 900 pixels.

Use g.drawpicture thelogo, 0,0, 900,300,0,0,3600,1200

to get it onto the page.

[quote=326997:@Tim Turner]@Jean-Yves Pochez I’ve used PNG format to print at high quality on a printer, and it worked fine.
the png must be at the resolution of the printer.
I have tried 300dpi PNG at a size that places it onto the report at the size we need.
Still blurry. Jeff is recommending trying a higher resolution[/quote]
try to drag the png file into the xojo project, as an external ressource.
then add it to the report and print it
is it still blurry ?

With vector data EPS it’s different than pixel data, PNG or JPEG.

You need to convert the EPS to a 72 DPI bitmap, taking the DPI as a scaling factor. 300 dpi / 72 dpi = 4.1666666667

So create the image with the width and height multiplied by 4.1666666667 and then draw your EPS filling that image. Then you can set the DPI on the bitmap to be 300 dpi.

If your client is on a Mac, and your project uses the Retina Kit for drawing images, they can load EPS, PDF directly in.

Ah I wish I was there. Still on an old version of xojo because of the old stylegrid which I have to replace in order to move up to newer xojo. Just haven’t had time.

Don’t really understand what you are saying Sam. In Illustrator I was actually setting the DPI to 300 dpi and setting the size of the logo to the size I need and exporting it out to jpg or png… tried both.

I think somehow the logos are getting enlarged when I place them on my printout vs. shrunk down to “print size” that the graphic file says is it its print size if I look at it in AI or Fireworks or Photoshop.

I was actually setting the DPI to 300 dpi and setting the size of the logo to the size I need and exporting it out to jpg or png… tried both.<<

Forget 300 dpi. DPI is a terrible idea, in my opinion. Its only a hint about how big to print a bag of pixels.

Let me repeat what Sam and I are trying to say:

Get the size of the page in inches.
Multiply by 1200 (I do not care about dpi)
Create a picture of that size.

Draw the logo onto that picture so that it fills it.
Now it is 4 times bigger than it needs to be for 300 dpi, and it is smooth.
Save that picture as a PNG file.

Import it into your program or .openaspicture

Geta printer graphic of 300 dpi
Draw the picture onto the printer page, reducing it in size to fit
It will not be jagged.

I do this literally every day.

[quote=327043:@Jeff Tullin]Draw the picture onto the printer page, reducing it in size to fit
It will not be jagged.[/quote]

I believe when I “draw it to the page” I have to reduce it in size.
Drawpicture is always in pixels?

Your other example was if huge image needs to be drawn 3 inches wide instead of the actual size of image…
then that’s 900 pixels wide and that is used in the Drawpicture call.
So one inch height would be 300 pixels?

If I write code to “scale down” the big huge graphic to the area I need it drawn to… maybe I can write the code to scale it down…

actualBigPic.Height/300 * heightDesired

Just trying to confirm I got it right… (and thanks in advance for all the help!!!)

You may want to use the ResizeToFit code here https://forum.xojo.com/12211-proportionally-resizing-a-picture/0

That makes it easy to get the picture exactly sized to the printer’s resolution.

If your printer reports 300 dpi, then 300 is one inch.
Doesn’t matter how big the original image is, use drawpicture to make it fit into sizewantedininches * 300

If the original picture is small (say 60 pixels across), you get a jagged picture.
If its 3600 pixels across, you get a smooth picture.

.drawpicture can be considered to be always in pixels. Some may call them points.

a 3600 pixel image ‘is’ a lot of different sizes if you consider it as 72, 144, 300 or 360 dpi
Dont worry about the dpi of the picture

if you have a 3600 pixel square picture and you want it to print at 3 inches on a 300 dpi printer,
you need to .drawpicture it like this

g.drawpicture thepic,0,0,900,900, 0,0,3600,3600

900 is 300 x 3

Just what I needed!

Jeff thanks for the tutelage… very helpful in understanding all of this. Very much appreciate it!