Rank: Newbie
Groups: Registered
Joined: 5/1/2021(UTC) Posts: 2 Location: Milan
|
Hi to all, I need to implement a new option in my sw. Receiving pdfs with multilayer(OCG) I have to render them with overprint flag in order to prevent some layer cover other. I tried using : Code:
foreach (var pgobj in page.PageObjects)
{
pgobj.OverprintMode = OverprintModes.NonZero/Zero;
pgobj.StrokeOverprint = true/false;
}
Nothing change in the saved image, the last layer cover others..... David Edited by moderator Saturday, May 8, 2021 9:34:41 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,104
Thanks: 7 times Was thanked: 129 time(s) in 126 post(s)
|
After changing any property of the page object, you must call the GenerateContent method for the changed information to take effect. Try calling page.GenerateContent() after your foreach loop.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/1/2021(UTC) Posts: 2 Location: Milan
|
Sorry Paul,
but nothing change can I send you the pdf to check if it's possible to render it correctly?
David
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,104
Thanks: 7 times Was thanked: 129 time(s) in 126 post(s)
|
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 19 Location: Rio de Janeiro Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, I'm trying to load the document with overprint flag ON, but have no success yet. Here is my code: Code:
foreach (var page in pdfViewer.Document.Pages)
{
foreach (var pgobj in page.PageObjects)
{
pgobj.OverprintMode = Patagames.Pdf.Enums.OverprintModes.NonZero;
pgobj.StrokeOverprint = true;
pgobj.FillOverprint = true;
}
page.GenerateContent();
}
pdfViewer.ClearRenderBuffer();
pdfViewer.Invalidate();
Thanks in advance!
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 19 Location: Rio de Janeiro Thanks: 2 times Was thanked: 1 time(s) in 1 post(s)
|
Still unclear how to render or view correctly a document with Overprint. Please @PaulCode:using (var bmp = new PdfBitmap(width, height, true, true)){
var page = document.Pages[Page];
foreach (var pgobj in page.PageObjects)
{
pgobj.OverprintMode = OverprintModes.NonZero;
pgobj.StrokeOverprint = true;
}
page.GenerateContent();
bmp.FillRect(0, 0, width, height, Patagames.Pdf.FS_COLOR.White);
//Render part of page into bitmap;
page.RenderEx(bmp, 0, 0, width, height, PageRotate.Normal, RenderFlags.FPDF_LCD_TEXT);
bmp.Image.Save("over.png");
}
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close