Include ICC Colour Profile in PDF created with Objective-C iOS?

╄→гoц情女王★ 提交于 2019-12-21 17:55:34

问题


In my Objective-C iOS app I'm creating PDF files using the code:

UIGraphicsPDFRenderer* renderer = [[UIGraphicsPDFRenderer alloc] initWithBounds:pdfSize];
NSData* outputPdfData = [renderer PDFDataWithActions:^(UIGraphicsPDFRendererContext * _Nonnull context) {
    [context beginPage];

    // draw operations here
}];

The ultimate aim is to then send this PDF to an AirPrinter.

However, due to the printer hardware we're using it looks like it is going to be necessary to embed in to the PDF an ICC colour profile (possibly CMYK) to ensure accurate colour reproduction.

I've done such operations before in .Net but never in Objective-C and so far all of my web searching has been for nought.

Is it possible to embed ICC colour profiles in to the PDF context in Objective-C using the above approach, or if not is there another way to produce PDFs in Objective-C that does allow ICC profile embedding?


回答1:


After a lot of searching I've concluded this isn't possible. Documentation is thin on the ground and what does exist usually refers to Mac OSX, not iOS. ColorSync, as suggested by Moose, appears to be restricted to images and UI elements, and I can see no way of including it in PDF creation. Closing.




回答2:


Maybe you could try to create a colorSync profile for the printer you use, and let the system correctly prepare you document for this printer, or any another one..

ColorSync is supported since OS9.3 on iOS Devices.



来源:https://stackoverflow.com/questions/49163537/include-icc-colour-profile-in-pdf-created-with-objective-c-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!