PDF traversal

as mention in pdf 32000
pdf structure is like below image
what is the best solution for traversal this structure?
something like this or not
CosDoc cdoc;
cdoc = PDDocGetCosDoc(myPDDoc2);
CosObj cosOBJ=CosDocGetRoot(cdoc);
CosType t = CosObjGetType(cosOBJ);
  CosObj obj2= CosDictGet(cosOBJ,ASAtomFromString("Pages"));
  CosObj obj3= CosDictGet(obj2,ASAtomFromString("Kids"));
  CosObj kid1 = CosArrayGet(obj3,0);
  CosObj cosst = CosDictGet(kid1,ASAtomFromString("Contents"));
  CosObj resou = CosDictGet(kid1,ASAtomFromString("Resources"));
  PDEContent pddd=PDEContentCreateFromCosObj(&cosst,&resou);
  int jjj=PDEContentGetNumElems(pddd);
  for(int i=0;i<jjj;i++)
  PDEElement ele=PDEContentGetElem(pddd,i);
this elemnt is base of pdf structure or not
is there any function for determine the cos object type (Pages , dictionarys, Kids ,....)?
i want to traversal  the pdf structure for create a same pdf file (dont want use copy or any thing like that i want traversal to details then make another copy of pdf ( and maybe do some little changes in contents not structure ))
is there any way you can show me ?

1. The structure illustrated shows only PDF objects, both direct and indirect. You go beyond this into looking at the PDF contents as objects. This (PDF contents as objects) is not from 32000-1 at all. 32000-1 defines only contents as streams of operators and operands. PDFEdit is an abstraction of this to make editing simpler, to save you parsing PDF streams.
2. You can get object type. Look at the object methods starting CosObj. Look also at the options for enumerating objects, as that is the only way you can get a full list of the keys used in a dictionary.
3. It is entirely possible to duplicate objects or collections of objects (e.g. pages) into other PDFs by precisely examining Cos structure, duplicating stream contents etc. Beware! Some PDF files have recursive references. If you do not trap this your code will never finish,

Similar Messages

  • PDF-to-PDF link works online, fails on CD

    We publish multi-part PDF docs on the web and on CD. Inside them are occasional placeholder pages for large maps, with the text CLICK HERE TO VIEW linked to an external file, also a PDF. We make the links with AA's Link tool. (Draw a rectangle around the text, Open File, browse to the map file, etc., you know the drill.) We’ve done this for years, but recently:
    - Clicking the link from the local file finds the map just fine.
    - Posting the doc and map to the web, opening the doc online (IE), and clicking the link in it for the map works fine.
    - Burning the webpage, doc, and map to a CD in the exact same configuration puts up a Security Warning box when we click the map’s link inside the document. The box says the doc is trying to connect to [map's path (correct path)] and offers responses of Help, Allow, or Block. Clicking the obvious ‘Allow’ has no effect!
    The CD setup has worked fine for years but now suddenly fails. Is there some parameter in IE that's wound too tight?
    I've posted a sample of how it works. To see it, open the first doc linked on http://www.speakeasy.org/~mtangard/test/example.htm and click the red CLICK HERE.. link on page 5 or page 7.
    Using Acrobat 9 Pro and IE 8.0.6. Grateful for any clues....
    Mark

    Dump the web page.
    For deployment of PDF collections on optical storage media (OSM) avoid "entry" to the collection(s) from an HTML file on the OSM.
    Rather, always provide a "start" PDF that is on the root of the OSM.
    This avoids having to rely on the end-user's browser or browser version or one software house's updates gobbering another house's application.
    Provided the PDFs are not PDF Packages, Acrobat 9 Portfolios, or Acrobat X Portfolios end-users with Adobe Reader / Acrobat back to version 5.x can use the PDFs in a reliable manner.
    n.b., if a Cataloged Index or tiered indices are utilized users of version 5.x are 'locked out' as the licensed search engine/index builder was changed in version 6.x
    Create a staging "burn zone" on a local machine's HDD.
    Identified the common "parent" directory/folder that exists on the web deployment.
    At the provided web space example this would be directory/folder "fier".
    --| feir
    .... file: exec_summ.pdf
    .... --| figs
    ....  .... file: fig_es-1.pdf
    ~
    ~
    When a link path traverses through directories/folders on its passage to a target file this very specific "path" must be maintained when a file collection is transfered.
    True for a transfer of files to other web space, network space, other local machines, USB device, or OSM (any format - PDF, HTML, whatever).
    ~
    ~
    So, with the parent "feir" and its child content present in the 'burn zone' what goes to OSM will contain functional links.
    A Windows autorun file on the OSM root affords the possibility of calling Adobe Reader from the local machine to render the "start" PDF.
    If, for the PDFs in the 'burn zone, a Catalog Index has been created then associate the PDX file to the 'start' PDF.
    With it all on an OSM, the user has a mounted PDX as soon as the 'start' PDF is opened. This supports "anytime" use of Advanced Search.
    n.b., newer releases of Acrobat / Adobe Reader can be expected to provide a security dialog when the PDX is accessed.
    Be well...

  • Reader 9.3 produces Runtime error for all .pdf files on hard drive and email

    Does anyone have a resource that can show me how to eliminate a runtime error with Reader 9.3.1, Windows XP w/ SP3 and IE7. I have recently had all .pdf files located on my hard drive and in emails refuse to open because of this message:
    "Runtime Error!
    Program C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe
    This application has requested the Runtime to terminate it in an unusual way.  Please contact the application's support team for more information."
    So far, I have uninstalled and reinstalled Reader 9.3 from the website; added update 9.3.1 and tried to reopen files with no success.
    My organization sends a ton of .pdf files and it is not good when you can't open them for review and action.

    Hi All,
    Although I don't normally post in forums, I thought it prudent to lay this matther to rest.  I have tested the following solution:
    It appears that Adobe Reader likes to check access to each parent folder as well as the actual application data folder.  Apparantly there are other programs that also do similar things. As a result if you have your appdata redirected to \\server1\profiles\%username%\appdata adobe reader would first try directly access \\server1\profiles.  If the user does not have to Traverse folder permission, this fails. Typically you will need to change your permissions on you profile share from:
    -                   Users - Read Attributes (Apply to: This folder, subfolders and files)
    -                   Users - Read Extended Attributes (Apply to: This folder, subfolders and files)
    -                  Users - Create Folders/Append Data (Apply to: This folder, subfolders and files)
    -                   Users - Read Permissions (Apply to: This folder, subfolders and files)
    To the share permissions suggested by Microsoft in KB 274443:
    -                   Everyone - Create Folder/Append Data (Apply onto: This Folder Only)
    -                   Everyone - List Folder/Read Data (Apply onto: This Folder Only)
    -                   Everyone - Read Attributes (Apply onto: This Folder Only)
    -                   Everyone - Traverse Folder/Execute File (Apply onto: This Folder Only)
    Hopefully this helps everyone.

  • Help with PDF creation using CFDOCUMENT / iText

    Hi everyone,
    Finally made the jump to CF7 after sticking with 5 for way
    too long and now have an urgent need to generate PDF.
    <cfdocument> seems to do better than anything else at
    converting HTML styled with CSS, but falls short in a few
    fundamental areas. What I need to do ( to name 3) is:
    * Generate a table of contents - including page numbers
    * Have far greater control over the headers / footers
    * Swap page orientation mid-document
    I can get round the page orientation thing by creating each
    section as an individual PDF and gluing them back together using
    PaulH's excellent PDF concatenation code. Using <cfdocument>
    I can reserve space for the headers / footers, and add a table of
    contents with placeholders for the numbers.
    Now, my question: Will I be able to rewrite all the page
    numbers, finish off the table of contents and headers / footers
    using iText? i.e. traverse the concatenated PDF file, rewrite the
    headers / footers, work out the page numbers and rewrite the TOC?
    I'm not asking for sample code or even a how to - just a
    heads-up from some who knows iText well and can quickly say whether
    this is feasible.
    I hope it is because my alternative approach is to go down
    the xsl-fo route which I suspect will be more effort in the long
    run.
    Thanks
    PJ

    as alternative solution you might check activepdf products.
    www.activepdf.com
    cheers
    kim

  • How to get dom object from acrobat pdf

    I am following the the document "PDF Accessibility API Reference" and following the section "Reading PDF files thru DOM Interface". There he mentions about including
    AcrobatAccess.h, AcrobatAccess_i.c and IPDDom.h. Please let me know where I can find these files. Also, How can I get a dom object to start with. If you have a sample code to share, that would be great. I tried googling about these but was not very successful in getting this info.
    Any help towards this is appreciated.

    Hi Leonard,
    I think there is something called GetCaret function mentioned in DOM interface which basically returns IPDomNode underneath caret. Also, in Accessibility side, accHitTest() function is there.
    I think today when I explored our product, some body has written wrappers over accessibility apis to get some good information. Anyways thank you very much for all your replies.
    One last question before I leave home:-)
    I have accessibility object representing a active page (page which is visible). Now using accessibility apis, I can traverse the tree of accessbility objects that belong to/Underneath page. Now to get the same on a different invisible page, what should I do. Calling getParent at a page level accessibility object returns null? SOmething like I want an accessibility object whose children are "the all the pages of the document".

  • FrameMaker bookmarks are misplaced in PDF

    I use FrameMaker 9.0p237
    When I create a PDF from a FrameMaker book, the bookmarks are misplaced in the PDF. For example, in my Frame file, I have:
    Chapter Title A
    .Heading 1 a
    ..Heading 2 a
    Chapter Title B
    .Heading 1 b
    ..Heading 2 b
    But, when I create the PDF, some of the chapters' bookmarks appear as:
    Chater Title A
    Chapter Title B
    .Heading 1 a
    ..Heading2 a
    .Heading 1 b
    ..Heading 2 b
    This doesn't happen for every chapter, but it does happen consistently for the same chapters each time I create a pdf.
    What is wrong with my FrameMaker file that would cause this?

    Sheila,
    You are right! It is a flow issue. I had checked the flow earlier, but it showed each section as the same flow. But, then I tracked the flow by:
    Zoom out to 25% and adjust the window size to see as many pages as necessary.
    Click in the flow you want to check and choose Edit > Select All In Flow. The flow is highlighted, showing how it traverses the pages of the document.
    The frame that contained the chapter title had become disconnected. So, all I had to do was reconnect them by:
    1.     Select the first frame.
    2.     Select the second frame.
    3.     Format > Customize Layout > Connect Text Frames.
    Thank you for your help. You led me to the correct path!

  • What is the proper HTML code for I linking to a destination in a .pdf file in firefox?

    If I create an HTML link to a destination within a .PDF file, it works fine in IE but not in Firefox. The code I use is this:
    <a href="website/pdf-file.pdf#destination-name>

    Cool. Thanks to you both.
    I vaguely recall doing a "chmod 700" on my previous machine. Those strict permissions survived the migration to this one it seems. "chmod 755" will be fine now. I wanted to know what the default was. Now I do Thank you!
    Here is a quote from the Wikipedia entry on Filesystem_permissions:
    <it>"The execute permission, which grants the ability to execute a file. This permission must be set for executable binaries (for example, a compiled c++ program) or shell scripts (for example, a Perl program) in order to allow the operating system to run them. When set for a directory, this permission grants the ability to traverse its tree in order to access files or subdirectories, but not see files inside the directory (unless read is set)."</it>

  • Possible to create multiple pdf files from links?

    In Acrobat X Pro, is there a way to apply the option "create pdf file from link" to several links on the same website at once?.thanks

    About the closest you can get is to use the Tools > Document Processing > Web Capture > Append all links on page command, which will traverse the links and append them to your existing PDF that has been captured from a web site.

  • Display multiple pages of PDF in ABAP webdynpro

    Hi Friends,
    We have a requirement, where we have to display all the pages of PDF in ESS Portal using Abap WD.  I have got the xstring data for all PDF pages.   How can I display them now? 
    I used interactive form, but it can display just one page.  Is there any method or UI element by which multiple pages can be displayed.
    Please provide your valuable inputs.
    Thanks,
    Sumeet

    The pdf is stored in spool in parts, and are not in single pdf file.  I have managed to get the xstring values for all the pages.  Saying multiple pages, I mean there multiple individual pdf page.  We cannot scroll them, but need some kind of button to traverse to next page. 
    I wanted to know, if there is anything helpful in Webdynpro to display it.

  • ADF Tree Traversal from one node to its leafs

    Hello,
    after a titanic effort I have been able to add a checkbox next to each node of an adf tree table.
    This checkbox is based on an "helper" entity attribute (not mapped to a column table on the database).
    My next huge problem is to perform an automatic selection of all the checkboxes next to the nodes under the currently selected one.
    For example, if the user checks a checkbox in the second level, then all the checkboxes next to the nodes under that, belonging to level three and four must be checked.
    If this helps, in my case there are at most four levels.
    Up until now I can get all the information from the currently checked node, but I fail to navigate the hierarchy under it for the automatic checking. I think that one problem is to navigate all the rows in the (only) VO the tree is based on. For example, since the tree is not expanded at the beginning, if I iterate on the VO retrieved from the current selected node at the top level, I can't see any rows corresponding to any children. Maybe I just miss something.
    I have followed this example from Frank Nimphius, which only gets the current selected nodes, as I said, but no more. Maybe this is a good starting point, but I need to advance somehow.
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/32-tree-table-from-single-vo-169174.pdf
    Can anyone help?
    Thanks.

    Hi,
    here is a sample of how to search in trees, which actually shows how to traverse trees from a specific node
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/61search-in-rendered-trees-177577.pdf
    Given you have a transient attribute defined, each node (and instance of JUCtrHierNode --> getRow will give you access to the attribute for read/access). Note that because the checkbox is stamped in the context of the tree, upon selecting a parent node, you need to refresh the tree to show the selection state change
    Frank

  • Any tips on reducing saved pdf files for emailing?

    I have an imac with Snow Leopard 10.6.8. I want to send a particular company 2 pdf documents I have scanned and saved to the desk top. The email keeps bouncing back. I have reduced the two attachemnts to one- but that doesnt work either. I cant seem to find a way to reduce the size of the pdf attachemtns. I read on line to go into Preview, file, export and choose the reduce option there- but if I go inot Preview, file - I dont have an export option.
    Any solutions gratefully received.
    Thanks
    Rarmy

    Those are almost certainly scans embedded within a PDF container file.  Either transfer the files via Dropbox or another file-sharing service, or re-gengerate the scans using lower resolution scan or (maybe) changes to the contrast settings in the scanner, or try compressing the scans (if the scans are not already compressed, as various tools that wrap scans in PDFs will attempt that).
    FWIW, I'm going to guess that this question isn't an OS X Server question but more likely a question involving 10.6 and mail, and you're not looking to adjust the maximum mail message size quotas for the mail messages traversing the mail server within an OS X Server system.  If you are, then that's usually via Server Admin.app or Server.app or manual commands issued at the Terminal.app prompt, depending on the version of OS X Server involved.

  • How to hide pdf in export option in ssrs ReportViewer

    Hi,
    This is the code which is used for ReportViewer 2008 and i need code for ReportViewer 2010.
    so please help me out asap.
       private void CustomizeReportViewer(System.Web.UI.Control reportControl)
                foreach (System.Web.UI.Control childControl in reportControl.Controls)
                    if (childControl.GetType() == typeof(System.Web.UI.WebControls.DropDownList))
                        System.Web.UI.WebControls.DropDownList ddList = (System.Web.UI.WebControls.DropDownList)childControl;
                        if (ddList.ToolTip.Contains("Export"))
                            ddList.PreRender += new EventHandler(ddList_PreRender);
                    if (childControl.GetType() == typeof(System.Web.UI.WebControls.Button))
                        System.Web.UI.WebControls.Button ddList = (System.Web.UI.WebControls.Button)childControl;
                        if (ddList.UniqueID.Contains("ctl00_ContentPlaceHolder1_rptviewerByBrandBySentimentAttribute_ctl06_ctl04_ctl00_Button"))
                            ddList.PreRender += new EventHandler(ddList_PreRender);
                    if (childControl.Controls.Count > 0)
                        CustomizeReportViewer(childControl);
            // This is the event handler added from CustomizeRV 
            // We just check the object type to get what we needed. 
            // Once the dropdownlist is found, we check if it is for the ExportGroup. 
            // Meaning, the "Excel" text should exists. 
            // Then, just traverse the list and disable the "Excel". 
            // When the report is shown, "Excel" will no longer be on the list. 
            // You can also do this to "PDF" or if you want to change the text. 
            void ddList_PreRender(object sender, EventArgs e)
                if (sender.GetType() == typeof(System.Web.UI.WebControls.DropDownList))
                    System.Web.UI.WebControls.DropDownList ddList = (System.Web.UI.WebControls.DropDownList)sender;
                    System.Web.UI.WebControls.ListItemCollection listItems = ddList.Items;
                    if ((listItems != null) && (listItems.Count > 0) && (listItems.FindByText("Excel") != null))
                        foreach (System.Web.UI.WebControls.ListItem list in listItems)
                            if (list.Text.Equals("XML file with report data") || list.Text.Equals("CSV (comma delimited)") || list.Text.Equals("TIFF file") || list.Text.Equals("Word") || list.Text.Contains("PPS"))
                                list.Enabled = false;
    susana w

    Hi God’s Favorite,
    Thanks for your post.
    According to your description, you would like to disable the SSRS rendering format PDF in VS 2010 ReportViewer control, please
    refer to the steps below I demonstrate for you:
    1. Add the method below to your .aspx.cs file as back-end code.
    /// <summary>
    /// Hidden the special SSRS rendering format in ReportViewer control
    /// </summary>
    /// <param name="ReportViewerID">The ID of the relevant ReportViewer control</param>
    /// <param name="strFormatName">Format Name</param>
    public void DisableUnwantedExportFormat(ReportViewer ReportViewerID,
    string strFormatName)
    FieldInfo info;
    foreach (RenderingExtension extension
    in ReportViewerID.ServerReport.ListRenderingExtensions())
    if (extension.Name == strFormatName)
    info = extension.GetType().GetField("m_isVisible",
    BindingFlags.Instance |
    BindingFlags.NonPublic);
    info.SetValue(extension, false);
    2. Choose the relevant Reportviewer control and press F4.
    3.  In the Properties window, click the Events icon, then double click the PreRender item to generate the
    ReportViewer1_PreRender method, I assume your reportViewer control ID is ReportViewer1,
    edit your method like below:
    protected void ReportViewer1_PreRender(object sender,
    EventArgs e)
    DisableUnwantedExportFormat((ReportViewer)sender,"PDF");
    After you complete the steps above, run your project and it works just as you expected.
    Thanks,
    Bill Lu
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • 3D PDF - Replace Part Names

    Hello
    We are creating 3D PDF files from Autodesk Publisher for our client to use for review of the assemblies. Feedback from the client has revealed that they are struggling to navigate the parts hierarchy tree in Adobe Acrobat Viewer because all the parts are displayed using the part numbers which Autodesk Publisher uses by default.
    Is it possible to develop a .NET application which can access the 3D element of the PDF file, traverse the parts hierarchy and replace the item name with an alternative which could be looked up from the original Autodesk Inventor 3D model?
    We are also seeing if we can use the Part Description instead of the Part Number when creating the 3D PDF file but I appreciate that that discussion is to be held elsewhere.
    Thank you.
    Chris

    [ moved to the SDK forum as it's more of a coding question than a 3D question ]
    In theory yes - while there's not a lot of high-level access through the 3D plugin made available to the SDK, you can of course read the raw data from the file structure with or without Acrobat and the SDK to help - but remember that the node data is inside the embedded U3D or PRC file, not in the PDF page structure. You'd basically be deflating the PDF stream, finding the file in the PDF COS structure as binary data, pulling it out, parsing it like a standalone model then putting it back. If you'e not touching the rest of the PDF document you'll be better off with a standalone application instead of a plugin.
    The 'could be looked up' bit is the nasty part, although the IPJ project file is XML, the IAM/IPT formats that actually contain the iPart properties are closed binary data. The part numbers are of course just the filenames, but you'd  need to export a BOM  as a CSV or spreadsheet and have your custom application do a text lookup if you wanted to find the parts within an assembly.

  • Traversal field in XML Source of LiveCycle Designer files

    Can someone explain to me how the Traversal field
    in XML Source relates to the tab order for an entire PDF form?  Like in my form i have the following, but both have 70 in them, but different names (field vs draw), but i dont know how that relates to the overall tab order of the entire PDF.
    <traversal><
    traverse ref="#field[70]"/></
    traversal> 
    <traversal><
    traverse ref="#draw[70]"/></
    traversal>

    It tells where to tab to next - those are attached to a field and point to the next field to go to.
    #field[70] and #draw[70] are field names in your form. I think those tags only show up if you start using custom tabbing order.
    Something looks odd though - did you name your fields with "#" in front? I might be wrong but that may cause problems for some things (not tabbing per se) - someone else here can hopefully correct me or not.

  • Converting all PNG to PDF in a folder

    This sounds like a problem fit for an Automator solution, but I don't know if this is possible:
    Recursively traverse all files in a folder (incl sub folders), finding all PNG files and converting them to PDFs.
    Then finally created a single ZIP file holding the entire source folder.

    GraphicConverter is probably the easiest to use and it is very flexible:
    http://www.lemkesoft.de/en/products/graphicconverter/key-features/batch-conversi on-with-additional-functions/
    For the ultimate in speed and options the more technically minded may wish to install and learn to use ImageMagick:
    http://www.imagemagick.org/script/binary-releases.php#macosx
    GraphicConverter is GUI based and ImageMagick is Terminal command based.
    It may be simplest to manually zip after conversion.
    I am sure you could use AppleScript or Automator but I would explore GraphicConverter first.

Maybe you are looking for

  • Frequent run-time errors during audio recording

    While recording audio voice-over for a slide, I'll often do several "takes" before finding the best one. All too frequently, when I click OK, I encounter a run-time error that terminates the Captivate 2 software. I've done the default installation on

  • J1INCHLN Challan Number

    Dear All I have a situation where, the J1INCHLN was processed and document number got generated but the Challan Number didnt get generated . What might be the reason? Pls guide as it is very urgent Thanks & Regards Veena

  • Refresh of table causes NullpointerException

    We have the following situation (JDev 11.1.1.3): A table with lots of rows, and multiselect. A link opening a dialog and in the dialogListener code to check something and maybe update the selected rows. When the dialog closes we want to refresh the t

  • Flash Player Installer 10.1 freeze during installation at 95% (mac OS 10.6.4)

    When i try to install flash player 10.1 on my macbook pro (Intelcore2duo, mac os 10.6.4, Safari 5.0.1), installer freeze at 95%. Impossible to install it. Any idea ? Thank's. David

  • Zcomponent to standard component navigation

    Hi All, I created Z comp., search req, search result are created.  they are working. in search result one field is activated with get p method of (hyper link). after clicking on field it should go to overview page just like other standard application