Rank: Newbie Groups: Member
Joined: 11/11/2024 Posts: 1
|
Recently moved from 21.1.93 EO.PDF dlls to 24.1.93 and noticed a preflight issue. 21.1.93 Preflight checks for Adobe Acrobat Digital printing (B/W) shows 1 plate Black, while same code passed through 24.1.93 version (and same Preflight check) reveals 4 plates (Cyan, Magenta, Yellow, Black).
Document images on CMY plates (2 matches on 1 page) - 1 Object uses RGB (2 matches on 1 page) - 1 Number of plates: 4 Names of plates: "(Cyan) (Magenta) (Yellow) (Black) "
Any suggestions for the following code and/or PDFDocument settings, HtmlToPdfOptions, etc? Expecting B/W Preflight check to pass.
var width = 61.56f; var margin = 0f;
float longPageLength = 200f; var pageWidthInches = width / 72; var marginInches = margin / 72; var pdfOptions = new HtmlToPdfOptions { PageSize = new SizeF(pageWidthInches, longPageLength), OutputArea = new RectangleF(marginInches, marginInches, pageWidthInches - marginInches, longPageLength - marginInches), AutoFitX = HtmlToPdfAutoFitMode.None, AutoFitY = HtmlToPdfAutoFitMode.None, NoScript = true,
GeneratePageImages = false, };
var html = "<p>Black and white test</p>";
PdfDocument doc = new PdfDocument(); HtmlToPdfResult res = HtmlToPdf.ConvertHtml(html, doc, pdfOptions); float docLength = res.LastPosition + marginInches; // Add extra length for margin
// Move to bottom of page and cut off top PdfMatrix matrix = new PdfMatrix(); matrix.Translate(0, (-longPageLength + docLength) * 72); doc.Pages[0].Transform(matrix); doc.Pages[0].Size = new PdfSize(pageWidthInches, docLength);
byte[] pdfBytes; using (var ms = new MemoryStream()) { doc.Save(ms); pdfBytes = ms.ToArray(); }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,245
|
Hi,
We looked into this and it does not appear there is any way for EO.Pdf generated PDF file to pass PreFlight check on print profile.
The root of the issue is internally EO.Pdf uses the Chromium rendering engine to render the HTML into PDF. However Chromium rendering engine always use RGB color model. As such the result PDF file always uses RGB color model. Printing on the other hand is always based on CMYK color model. Normally, when a RGB color is sent to the printer, the printer driver would perform the conversion which typically involves color profiles.
It is possible to bypass such conversions by using CMYK color model directly in the PDF file. This appears to be what PreFlight check print profile requires. You can only use a single plate (K = Black) or all four plates (CMYK). However since EO.Pdf always uses RGB color model, it will not satisfy either conditions. I am not sure what's caused the one plate/four plates difference you observed either.
As such the only way is to use another tool to perform such conversions. For example, in Adobe Acrobat Pro, you can select "Use print production -> Convert colors" tool to perform the color space conversion. Once converted, it is "print ready" and should be able to pass the print profile. However I understand that this process can not be automated programatically so it may not be suitable for you.
In the future we may implement this as a separate tool/API so that you can call directly from your code.
Hope this information is useful. Please feel free to let us know if you still have any questions.
Thanks!
|