Skip to content

Conversation

@dreampiggy
Copy link
Collaborator

PR descrition

This PR support to export the vector PDF data, from UIImage/NSImage instance. Which keep the original vector data (may loss PDF metadata on iOS only, macOS does not impact).

See the result:

NSData *pdfData = [image sd_imageDataAsFormat:SDImageFormatPDF];
[pdfData writeToFile:@"/tmp/1.pdf" atomically:YES];

image

}

CGPDFBox box = kCGPDFCropBox;
CGPDFBox box = kCGPDFMediaBox;
Copy link
Collaborator Author

@dreampiggy dreampiggy May 12, 2019

Choose a reason for hiding this comment

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

Actually, we should use mediabox for general usage. The PDF with cropbox may contains conflict issue when using on iOS with alignmentInsets. If user want, they can do post-processing using transformer. Or this may become a extra decoding options in the future.

@dreampiggy dreampiggy force-pushed the feature_export_pdf_data branch 3 times, most recently from ec544b5 to d0b5e40 Compare May 12, 2019 07:55
@dreampiggy dreampiggy force-pushed the feature_export_pdf_data branch from d0b5e40 to c0b3140 Compare May 12, 2019 08:03
@dreampiggy dreampiggy merged commit d4a6345 into master May 12, 2019
@dreampiggy dreampiggy deleted the feature_export_pdf_data branch May 12, 2019 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants