Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create icons directly from pdf data #9

Merged
merged 1 commit into from Jul 29, 2012

Conversation

MSNexploder
Copy link
Contributor

I recently had the use case of loading icons dynamically using a web service.
In order to use your library I added the ability to load pdfs directly from NSData.

Maybe this could be beneficial to others as well.

@@ -945,8 +1013,7 @@ CGImageRef CGImageCreateMaskFromPDFNamed(NSString *pdfName, CGSize size)
CGContextTranslateCTM(context, 0.0f, -mediaRect.size.height);

// Draw pdf
CGContextDrawPDFPage(context, firstPage);
CGPDFDocumentRelease(pdf);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, was this line unnecessary? Or accidental deletion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the CGPDFDocumentRelease(pdf); within the caller (e.g. Line 969 and 992) mostly because I try to keep memory management as local as possible (no hidden release calls without explicitly mentioning them in docs).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, silly question. I shouldn't have read just the diff.

@peyton
Copy link
Owner

peyton commented Jul 28, 2012

Looks great, thanks! Check out my comment on line 949 above btw.

peyton pushed a commit that referenced this pull request Jul 29, 2012
Create icons directly from pdf data
@peyton peyton merged commit 608be66 into peyton:master Jul 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants