mindbrix/UIImage-PDF

Shrinks Images Vertically

IamAliSufyan opened this issue · 8 comments

I am using this brilliant library in my app, but it shrinks every pdf vertically. I could not find any workaround. Please help!

Hi. Are you using an API that preserves the PDF aspect ratio, e.g.

UIImage *img = [ UIImage imageWithPDFNamed:@"YingYang.pdf" atWidth:60 ];

I am using this.
[imageView setImage:[ UIImage originalSizeImageWithPDFNamed:@"filename.pdf" ]];
Image in Pdf is Rectangular but it shrinks it vertically.

[imageView setImage:[ UIImage imageWithPDFNamed:@"filename.pdf" atHeight:70.0 ]];
It also shrinks and adds blur on image.

[imageView setImage:[ UIImage imageWithPDFNamed:@"filename.pdf" atSize:CGSizeMake( 40, 40 ) ]];
It only blurs the image.
Please help! I need to solve it ASAP.

@mindbrix Please help!

Sounds like you have a PDF with a bitmap in it. This only works for PDFs with pure vectors.

@mindbrix No, image is pure vector. it is drawn in Inkscape. I tried different pdfs, even your sample pdf shows blurry.

Please attach a screenshot.

[imageView setImage:[ UIImage imageWithPDFNamed:@"signals.pdf" atSize:CGSizeMake( 150, 150 ) ]];

screen shot 2013-09-20 at 5 16 09 pm

The image has to match the size of the UIImageView or scaling may occur, depending on the contentMode.