logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
bdavid  
#1 Posted : Saturday, May 1, 2021 6:27:33 AM(UTC)
bdavid

Rank: Newbie

Groups: Registered
Joined: 5/1/2021(UTC)
Posts: 2
Italy
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

Paul Rayman  
#2 Posted : Saturday, May 8, 2021 9:38:32 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,104

Thanks: 7 times
Was thanked: 128 time(s) in 125 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.
bdavid  
#3 Posted : Sunday, May 9, 2021 5:50:35 AM(UTC)
bdavid

Rank: Newbie

Groups: Registered
Joined: 5/1/2021(UTC)
Posts: 2
Italy
Location: Milan

Sorry Paul,

but nothing change can I send you the pdf to check if it's possible to render it correctly?

David
Paul Rayman  
#4 Posted : Sunday, May 9, 2021 7:57:19 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,104

Thanks: 7 times
Was thanked: 128 time(s) in 125 post(s)
Please contact support@patagmes.com
gffranca  
#5 Posted : Thursday, September 16, 2021 3:53:44 PM(UTC)
gffranca

Rank: Member

Groups: Registered
Joined: 11/1/2019(UTC)
Posts: 19
Brazil
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!
gffranca  
#6 Posted : Monday, November 7, 2022 9:23:19 PM(UTC)
gffranca

Rank: Member

Groups: Registered
Joined: 11/1/2019(UTC)
Posts: 19
Brazil
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 @Paul

Code:
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");
}
Users browsing this topic
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.