Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Removing Layer Based on Content Group |
Post Reply
|
| Author | |
Luke
Team Player
Joined: 13 Aug 10 Location: USA Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
Topic: Removing Layer Based on Content GroupPosted: 22 Aug 10 at 1:21AM |
|
I am trying to be able to Add and Remove Watermarks.
Currently I can add a Watermark with the following code: Result := FPDF.NewLayer; FPDF.DrawText( 100, 400, AWaterMark ); iContentGroup := FPDF.NewOptionalContentGroup( 'WaterMark' ); FPDF.SetLayerOptional( iContentGroup ); Now I want to be able to remove all Layers associated with the ContentGroup 'WaterMark'. I see how to find that group with for i := 1 to FPDF.GetOptionalContentConfigCount do begin if FPDF.GetOptionalContentGroupName( FPDF.GetOptionalContentGroupID( i ) ) ) = 'WaterMark' then begin // Find Layers associated with this Content Group end; end; How do I find all the layers linked to that Content Group? TIA.
|
|
|
Luke M. Miller
ResCorSoft, Inc. |
|
![]() |
|
Luke
Team Player
Joined: 13 Aug 10 Location: USA Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 Aug 10 at 5:17AM |
|
Any thoughts?
|
|
|
Luke M. Miller
ResCorSoft, Inc. |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 Aug 10 at 6:38AM |
|
Hi Luke!
Only in very general terms ... 1. NewOptionalContentGroup... 2. GetOptionalContentGroup... 3. You have to set a new layer. 4. You have to select this layer. 5. Make your drawings (perhaps with transparency... looks better)... 6. Save... 7. ... The problem could be that later after new loading you don't know the contentgroup-id anymore. My idea: With QuickPDF you can create own custom fields in the pdf. There you could save the contentgroup-id to be read out later. Only thoughts... Cheers, Ingo |
|
![]() |
|
Luke
Team Player
Joined: 13 Aug 10 Location: USA Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 Aug 10 at 4:53PM |
|
Thanks though I'm not sure I understand. After new loading can't I figure out what the content group id by looping through the content groups checking for the Group Name that matches.
if FPDF.GetOptionalContentGroupName( FPDF.GetOptionalContentGroupID( i ) ) ) = 'WaterMark' then begin // Find Layers associated with this Content Group end; To help me understand, what's the point of assigning a layer to a content group if you cannot then find the all the layers of a particular content group?
|
|
|
Luke M. Miller
ResCorSoft, Inc. |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 Aug 10 at 6:36AM |
|
Hi!
Do it this way and you have the id: ... The problem could be that later after new loading you don't know the contentgroup-id anymore. My idea: With QuickPDF you can create own custom fields in the pdf. There you could save the contentgroup-id to be read out later. ... Cheers, Ingo |
|
![]() |
|
Luke
Team Player
Joined: 13 Aug 10 Location: USA Status: Offline Points: 26 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 Aug 10 at 3:31PM |
|
I'm sorry if I am not explaining myself well. This is my first time working with PDF's in code.
Since I already know the name of the Content Group, I can find the Content Group ID. I have enough control over the PDF's so don't really need to worry about someone else adding a content group with the same name. My problem is after I get the contentgroup-id, either from a custom field or by searching all the Content Groups for a specific name. How do I find the layers that I associated with content group? When I originally added my watermark, I associated that layer with the code: iContentGroup := FPDF.NewOptionalContentGroup( 'WaterMark' ); FPDF.SetLayerOptional( iContentGroup ); So, now I need to go backwords and find Layer(s) that I associated with that group. Hope I explained it better this time. ![]() |
|
|
Luke M. Miller
ResCorSoft, Inc. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() 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 |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store