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 - Modify PDF files model tree
  FAQ FAQ  Forum Search   Register Register  Login Login

Modify PDF files model tree

 Post Reply Post Reply
Author
Message
Justme View Drop Down
Beginner
Beginner


Joined: 17 Mar 14
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justme Quote  Post ReplyReply Direct Link To This Post Topic: Modify PDF files model tree
    Posted: 17 Mar 14 at 5:24PM
I am creating pdf files that have layer data so they can be turned off and on as needed. Some of the layers also have attribute data that can be displayed with the model tree in Acrobat Reader. The problem is when there are multiple layers it takes many clicks with the Adobe PDF Object Data Tool to select an individual object. The first click selects all objects on the page, the next double click selects all objects in a layer and finally the last double click will select the individual item and display the data in the information window. It is my understanding that is by design in Acrobat. You can preselect a layer in the UI first and then double click an object to get it to select but that takes just as long.

We however receive PDF files from various public sources that the model tree has been ungrouped or flattened. This allows for single click selection of any object on the page.

I just need to figure out how to do it can anyone point be in the right direction? Our files are being created in ArcGIS and I use the Quick PDF Library to add links, automate page navigation between files, etc.   
Back to Top
Justme View Drop Down
Beginner
Beginner


Joined: 17 Mar 14
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justme Quote  Post ReplyReply Direct Link To This Post Posted: 17 Mar 14 at 5:28PM
Sorry, sample of model trees

Widget
   123
   456
   789
Thing
   abc
   xyz

Change to

Widget: 123
Widget: 456
Widget: 789
Thing: abc
Thing: xyz
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 19 Mar 14 at 11:01AM
Justme,

Can you please upload a small sample file so we can see what is going on and post the section of code you are using to process the layers if any.

Andrew.
Back to Top
Justme View Drop Down
Beginner
Beginner


Joined: 17 Mar 14
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justme Quote  Post ReplyReply Direct Link To This Post Posted: 20 Mar 14 at 1:05AM
Thanks for the reply.  There are two PDF files at http://files.secureserver.net/0fhfMmWbZbZ5lp. The sample.pdf file is a very basic sample file.  If you look at the layers they are listed in a hierarchy which I would like to flatten and remove a few from the layers list that should always be on (Other, Lables, etc.).  The model tree is the same which I would also like to flatten.

The second PDF file is from a vendor.  Just select "No" for the plug in warning when opening.  Please note the flattened layers and model tree.  This is what I would like to do with the files I am getting from ArcMap.  Yes I could buy the program used to create the second PDF but at $7000 it is a little too expensive.

There are also a few image files showing before and after of what I have in mind for the layers and model tree.  Cannot get images to upload to the forum.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 21 Mar 14 at 5:26AM
Justme,

Debenu PDF Library doesn't currently have and functions to work with Adobe created Model Trees.  I suspect there is an output option in ArcGIS that can flatten these Model Trees during the creation of the PDF file.  I suspect there is not similar option available on ArcMap.

Layers are pretty well supported in Debenu Quick PDF Library but I am having trouble working out how the Model Trees are even created / specified in the PDF specifications.

Andrew.

Back to Top
Justme View Drop Down
Beginner
Beginner


Joined: 17 Mar 14
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Justme Quote  Post ReplyReply Direct Link To This Post Posted: 21 Mar 14 at 2:48PM
Andrew,
 
I was able to get the "Layers" fixed by digging/hacking through the raw binary file.  Apparently “/OCProperties<</D<</Order" controls the Layer tree.  Changed the following line, as noted below, and updated the affected xref and startxref pointers.  This will be done the "correct" way later just trying to figure it all out at the moment.
 
/OCProperties<</D<</Order[  19 0 R [ 20 0 R 21 0 R [ 22 0 R ] 23 0 R [ 24 0 R 25 0 R 26 0 R ] 27 0 R [ 28 0 R ] ]]>>/OCGs[ 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R]>>
 
To
 
/OCProperties<</D<</Order[  (Layers) 24 0 R 25 0 R 26 0 R ]>>/OCGs[ 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R 26 0 R 27 0 R 28 0 R]>>
 
Still working on the Model Tree but was making progress before calling it quits last night.  I think the model tree is controlled by the [Parent] [Kid] relationship of the objects.  I was able to hide the ones I did not want to show but also introduced an error into the file.  I think I just incorrectly recalculated one of the pointers.  Need to try setting the [Parent] of the I want displayed to the [Root] ??? and removing them from the their old [Parent] as [Kids].
 
Thanks for all your help so far.
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