Comments (5)
Same problem here. Trying to use this with SKTexture, but everything
appears upside down.
On Friday, October 10, 2014, Erik van der Neut [email protected]
wrote:
Hi Nigel,
I cannot tell you how excited I am to have your UIImage+PDF. This is an
amazing tool in simplifying the image asset management, especially now with
the introduction of @3x https://github.com/3x for the iPhone 6 Plus.Back in January 2012, algal reported having his images displayed upside
down. You replied you had never experienced that issue, and he figured out
that it was caused by assigning it to the layer's background instead of the
view's background.In my project I have replaced several UIImage creation lines of code with
your imageWithPDFNamed:fitSize: and imageWithPDFNamed:atWidth, and the PDFs
are displaying beautifully, but strangely enough all upside down :-( So far
I have not been able to figure out what I possibly could have done wrong.
Would you have any inkling as to how I should go about debugging this..?I can't attach examples of my PDF files -- it says "Unfortunately, we
don't support that file type. Try again with a PNG, GIF, or JPG.", but all
my PDFs are small in size.Thanks so much,
Erik—
Reply to this email directly or view it on GitHub
#30.
from uiimage-pdf.
What I'm doing is I think really basic stuff, for example setting button images:
UIImage *replayButtonImage = [UIImage imageWithPDFNamed:@"ec-control-button-replay.pdf" atWidth:120];
[_replayButton setImage:replayButtonImage forState:UIControlStateNormal];
Or something as simple as setting the image on a UIImageView:
_backgroundImageView.image = [UIImage imageWithPDFNamed:@"ec_background_mode.pdf" atSize:self.frame.size];
All images are rendering beautifully and at the right size. It's just that they are all upside down.
I'll keep moving forward with my implementation, but I will need a solution for this to complete this.
Anybody else out there who has experienced this and might have an idea what it could be?
Erik
from uiimage-pdf.
Hi Erik. Thanks for your feedback. I've just pushed a commit: 3be234d that should fix your problem.
Nigel.
from uiimage-pdf.
Hi Nigel,
I just came back here to tell you that if I commented out the following two lines, that all images appear correctly:
CGContextScaleCTM( ctx, 1, -1 );
CGContextTranslateCTM( ctx, 0, -size.height );
And now I see you have made that same change already and committed it.
Thanks so much!
Now, I'm just curious why that code was in there. In the 2012 thread with algal I see now that you referred to those lines as well. There must have been a deliberate intent behind that flipping.
Thanks for any further insights you can share. Either way: your UIImage+PDF is making me extremely happy - just so you know :-)
Erik
from uiimage-pdf.
Hi Erik. Great minds think alike ;-)
The flipping code is now redundant, as I now create the drawing context with CGBitmapContextCreate() instead of UIGraphicsBeginImageContextWithOptions(). The latter transforms the context differently.
Nigel.
from uiimage-pdf.
Related Issues (20)
- Question using exported PDF files with transparency HOT 6
- Invalid context HOT 6
- Crashes on CGContextDrawPDFPage( ctx, page1 ); HOT 11
- Interesting lib! Can you do the same with SVG assets? HOT 1
- Importing wrong headers HOT 1
- Cache key HOT 1
- Change PDF clear background to white as default HOT 1
- Documentation lacking
- Suggestions for setting image in button
- Image scaling and rotation issues. HOT 22
- My PDF images are no longer resized
- PDF size increases but image doesn't HOT 1
- Ability to include annotations present in a PDF in the output image
- bixolon
- Please release a new Cocoapods version
- Saving UIImage generated from PDF and that image getting blank after previewing in Photos after tapping on Image
- Add to `pod` dependency manager
- Updates for Swift 3 compatibility? .image property breaks all over HOT 1
- Can CocoaPods be supported?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uiimage-pdf.