Graphics formats in printed reports

  1. 8 months ago

    Tim T

    20 Apr 2017 Pre-Release Testers, Xojo Pro Atlanta, GA

    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://docs.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.

  2. Dave S

    20 Apr 2017 San Diego, California USA

    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?

  3. Jeff T

    20 Apr 2017 Midlands of England, Europe
    Edited 8 months ago

    what does

    'exported as JPEG at the maximum size 10'

    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

  4. Jean-Yves P

    20 Apr 2017 Pre-Release Testers, Xojo Pro Europe (France, Besancon)

    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

  5. Tim T

    20 Apr 2017 Pre-Release Testers, Xojo Pro Atlanta, GA

    @Dave S Are you sure you printer is also at 300dpi?

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

    @Jeff T Take the EPS file and size it to the exact size at 1200dpi

    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.

    @Jean-YvesPochez 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

    @Dave S what ever command is inserting the graphic is not attempting to resize it even slightly?

    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.

  6. Tim T

    20 Apr 2017 Pre-Release Testers, Xojo Pro Atlanta, GA

    @Jeff T 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

    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.

  7. Jeff T

    20 Apr 2017 Midlands of England, Europe

    Can I read the EPS file directly or only PNG?

    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.

  8. Jean-Yves P

    20 Apr 2017 Pre-Release Testers, Xojo Pro Europe (France, Besancon)

    @Tim T @Jean-YvesPochez 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

    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 ?

  9. Sam R

    20 Apr 2017 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    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.

  10. Tim T

    20 Apr 2017 Pre-Release Testers, Xojo Pro Atlanta, GA

    @Sam Rowlands 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.

    @Sam Rowlands 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.

    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.

  11. Jeff T

    20 Apr 2017 Midlands of England, Europe

    >>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.

  12. Tim T

    21 Apr 2017 Pre-Release Testers, Xojo Pro Atlanta, GA

    @Jeff T Draw the picture onto the printer page, reducing it in size to fit
    It will not be jagged.

    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!!!)

  13. Michel B

    21 Apr 2017 Pre-Release Testers, Xojo Pro

    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.

  14. Jeff T

    21 Apr 2017 Midlands of England, Europe

    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

  15. Tim T

    21 Apr 2017 Pre-Release Testers, Xojo Pro Atlanta, GA

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

    Just what I needed!

    @Jeff T Doesn't matter how big the original image is, use drawpicture to make it fit into sizewantedininches * 300

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

or Sign Up to reply!