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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Removing Layer Based on Content Group
  FAQ FAQ  Forum Search   Register Register  Login Login

Removing Layer Based on Content Group

 Post Reply Post Reply
Author
Message
Luke View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Aug 10
Location: USA
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Luke Quote  Post ReplyReply Direct Link To This Post Topic: Removing Layer Based on Content Group
    Posted: 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.
Back to Top
Luke View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Aug 10
Location: USA
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Luke Quote  Post ReplyReply Direct Link To This Post Posted: 25 Aug 10 at 5:17AM
Any thoughts?
Luke M. Miller

ResCorSoft, Inc.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Luke View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Aug 10
Location: USA
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Luke Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Luke View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Aug 10
Location: USA
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Luke Quote  Post ReplyReply Direct Link To This Post 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.Embarrassed 

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.Smile

Luke M. Miller

ResCorSoft, Inc.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store