• When I upload a logo it always looks blurry on the invoice (PDF)

    I’ve tried JPG/PNG, the file size is tiny, not sure whats going wrong?

    Is there a certain criteria for logos?

    Mine is 200px x 30px and is only 7KB. Any help would be appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    200px x 30px is very small indeed, the logo is 3cm high which means that the logo is only 25dpi. A minimum of 150dpi is recommended, in your case this would mean you’d have to use an image of 1180 x 177 px (assuming the 200px is your width).

    Hope that helps!
    Ewout

    Thread Starter ts1983

    (@ts1983)

    I’m confused. I want an image thats 200px wide. If I use 1180×177 the image takes the whole width of the PDF.

    Plugin Contributor Ewout

    (@pomegranate)

    Ah I see – 200 px is not a width in a PDF, it needs to multiplied with a DPI setting to become an actual width (mm/cm/inch). The default height of the logo is set to a maximum of 3cm. If you want to adjust the height of the logo you can do that with CSS:

    
    td.header img {
    	max-height: 1cm;
    	width: auto;
    }
    

    Using custom styles

    Hope that helps!

    Thread Starter ts1983

    (@ts1983)

    Still confused. I’ve tried various sizes at various DPI’s and its always blurry OR takes up too much room on the PDF.

    What are the recommended settings to have a logo at?

    I’m just trying to have a logo at the top left of the PDF that doesnt look blurry and is not massive :/

    Are you saying it always changes the height to 3cm if the size is smaller?

    Plugin Contributor Ewout

    (@pomegranate)

    I’m sorry if that was confusing.
    200 px does not have a size in the real world, you need to define a size for each pixel in order to convert the number of pixels into a size (just like on a high resolution screen, an image will be smaller than on a low resolution screen because the pixel size is determined by the hardware). This is called dpi = dots per inch.

    The PDF invoice plugin sets a maximum height of 3cm for the logo, and uses a minimum of 72 dpi for the image. So for anything below 72*3/2.54 = 85 pixels, it will reduce the image dimensions.
    30px is tiny and will always be blurry.

    If you want a higher quality logo you can do either of the following:

    • Increase the size of your image to make it so that on 3cm the logo is 150dpi: this is about 177px high. if you have a very wide image you could add whitespace to compensate for this, but you’d need to add add that too (i.e. 354 pixels if the actual image is 1.5cm high). This would be a ‘trick’, but not the best solution
    • Change the height of the logo with CSS. So for a 1.5cm logo, upload a 177px high logo and use the CSS as in my previous post

    Hope that helps!

    Thread Starter ts1983

    (@ts1983)

    I am uploading high res 300dpi files at various widths and yet when I set the file, it tells me the file is a lot lower DPI, I.e. 30dpi. Is your plugin resampling and resizing???

    The actual dimensions dont seem to be the same as whats on the PDF either. In Photoshop if it says 2cm wide and I use it on the PDF, it takes up tons of room. No matter what I do, it doesnt work. So frustrating!

    Plugin Contributor Ewout

    (@pomegranate)

    The PDF invoice plugin is not resampling or resizing, only setting the dimensions of the logo in the final PDF. There may be other plugins in wordpress resizing the image though. Can you post a link to the image you’re using so I can test this for you?

    edit: just noticed your remark about the dpi in photoshop. This is NOT equal to the dpi in the PDF. Not all image formats support dpi, so when the image is saved it has become dimensionless. Photoshop adds extra header information so that it knows it’s dealing with a xxxdpi image, but that information is not available to all external applications.
    So if the size in photoshop is 2cm, you need to explicitly set the size of the image in PDF invoices at 2cm too!

    in CSS (assuming the 200×30 size you posted earlier):

    
    td.header img {
    	max-height: 3mm;
    	width: 2cm;
    }
    

    That’s very high res and small though. What are the dimensions of your image in cm/mm?

    • This reply was modified 9 years, 2 months ago by Ewout.
    • This reply was modified 9 years, 1 month ago by Samuel Wood (Otto).
    Plugin Contributor Ewout

    (@pomegranate)

    Hmmm seems like my previous post got lost in the forums (it counts my post and shows me as last poster but doesn’t show anything) 🙁
    Can’t repost either…

    Plugin Contributor Ewout

    (@pomegranate)

    Here’s what I wrote:
    The PDF invoice plugin is not resampling or resizing, only setting the dimensions of the logo in the final PDF. There may be other plugins in wordpress resizing the image though. Can you post a link to the image you’re using so I can test this for you?

    edit: just noticed your remark about the dpi in photoshop. This is NOT equal to the dpi in the PDF. Not all image formats support dpi, so when the image is saved it has become dimensionless. Photoshop adds extra header information so that it knows it’s dealing with a xxxdpi image, but that information is not available to all external applications.
    So if the size in photoshop is 2cm, you need to explicitly set the size of the image in PDF invoices at 2cm too!

    in CSS (assuming the 200×30 size you posted earlier):

    
    td.header img {
    	max-height: 3mm;
    	width: 2cm;
    }
    

    That’s very high res and small though. What are the dimensions of your image in cm/mm?

    Thread Starter ts1983

    (@ts1983)

    Hello

    My site is in maintenance mode so cant post the link but its 197×29

    (Ive also tried 200×30)

    Ive tried it with your CSS But nothing changes.

    Its very strange.

    Any chance of sending you this on slack? I could send you the PDF as well as the image. If so, I’m @omri on there.

    I’m away next week so may be slow at replying if I dont hear from you before.

    Plugin Contributor Ewout

    (@pomegranate)

    Sure – What slack team is that? I don’t see @omri on wordpress.slack.com
    I’m spreeuw on wordpress.slack.com, but you can also email me support@wpovernight.com

    Thread Starter ts1983

    (@ts1983)

    Brill, its EthicallyEvil. Thanks 🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Logo is always blurry’ is closed to new replies.