Importing one Pdf document into another.

I am trying to import one Pdf-document into another using a Reference XObject. I am looking at thePDF- specification, and I thought I was doing things the right way, but its not working. The PDF-specification doesen't have an example of how to do this, only an explanation.
Below is the PDF-file I am testing with (if anyone can be bothered looking at it   ). The file embeds another pdf-file, and is supposed to show a part of the embedded file at a certain position.
Again, if anyone can be bothered looking at my PDF and see if they can see what I am doing wrong here I would appreciate it.
(There is nothing wrong with the embedded file itself...)
PDF-file embedding another PDF-file and using a Reference XObject to display the embedded file:
%PDF-1.5
1 0 obj
<<
/Type /XObject
/Subtype /Form
/BBox [0 0 100 100]
/Ref <<
/F (4fa27162e72547a00771606.pdf)
/Page 1
>>
>>
endobj
2 0 obj
<<
/Type /Filespec
/F (4fa27162e72547a00771606.pdf)
/EF <</F 3 0 R>>
>>
endobj
3 0 obj
<<
/Type /EmbeddedFile
/Length 854
>>
stream
%PDF-1.5
1 0 obj
<<
/Length 334
>>
stream
q
1 0 0 1 128.10769621539 70.591821183642 cm
1 0 0 1 0 0 cm
1 0 0 1 0 0 cm
1 0 0 1 0 0 cm
1 0 0 1 -128.10769621539 -70.591821183642 cm
/DeviceCMYK CS
1 1 1 1 SCN
/DeviceCMYK cs
0 0.89 0.89 0.05 scn
0.2743205486411 w
2.743205486411 M
0 J
0 j
-1.9202438404877 -2.6517653035306 260.05588011176 146.48717297435 re
h
B
Q
endstream
endobj
2 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<>>
/XObject <<>>
>>
/MediaBox [0 0 255.11811023622 141.73228346457]
/Contents [1 0 R]
>>
endobj
3 0 obj
<<
/Type /Pages
/Kids [2 0 R]
/Count 1
>>
4 0 obj
<<
/Type /Catalog
/Pages 3 0 R
>>
endobj
xref
0 5
0000000000 65535 f
0000000010 00000 n
0000000401 00000 n
0000000568 00000 n
0000000624 00000 n
trailer
<<
/Size 5
/Root 4 0 R
>>
startxref
679
%%EOF
endstream
endobj
4 0 obj
<<
/Length 322
>>
stream
q
1 0 0 1 93.268986537973 71.826263652527 cm
1 0 0 1 0 0 cm
1 0 0 1 0 0 cm
1 0 0 1 0 0 cm
1 0 0 1 -93.268986537973 -71.826263652527 cm
55.961391922784 45.628651257302 74.615189230378 52.39522479045 re
W n
1 0 0 1 55.961391922784 42.062484124968 cm
74.615189230378 0 0 55.961391922784 0 0 cm
/XobjectPDF1 Do
Q
endstream
endobj
5 0 obj
<<
/Type /Page
/Parent 6 0 R
/Resources <<
/Font <<>>
/XObject << /XobjectPDF1 1 0 R >>
>>
/MediaBox [0 0 255.11811023622 141.73228346457]
/Contents [4 0 R]
>>
endobj
6 0 obj
<<
/Type /Pages
/Kids [5 0 R]
/Count 1
>>
7 0 obj
<<
/Type /Catalog
/Pages 6 0 R
>>
endobj
xref
0 8
0000000000 65535 f
0000000010 00000 n
0000000144 00000 n
0000000238 00000 n
0000001172 00000 n
0000001551 00000 n
0000001738 00000 n
0000001794 00000 n
trailer
<<
/Size 8
/Root 7 0 R
>>
startxref
1849
%%EOF

PDF is a binary format. The most important piece in a PDF file is the cross
reference table. It contains byte offsets to the different objects in a
file. If you insert just one space (which in a true ASCII file will not
change much), you are making all byte offsets after the insertion point
invalid. They now all point to something different than the start of an
object.
Because there is no standard about how line endings are encoded in text
files, every time may add (or subtract) a byte - depending on what computer
system and what editor you use to convert your PDF to fake-ASCII, and then
again what I use to try to convert it back to PDF. If you are using a
Windows system and I'm using a Mac, the cross reference table gets
corrupted. And that's even before the web server does it's magic and
potentially adds data.
If you want somebody to look at your file.
Have you looked at the post I linked to? The settings in Acrobat are
important. You need to enable Reference XObjects, AND you have to declare
the directory where your target file is stored as trusted.
From what I can see in your PDF code, you are doing a whole bunch of cm
operations. You may want to consolidate all those into one operation. I
have not done a detailed analysis, but you could potentially shift your
data off the page. Keep it simple and see if that makes a difference.
Karl Heinz Kremer
PDF Acrobatics Without a Net
[email protected]
http://www.khkonsulting.com

Similar Messages

  • How can I [cmd]+A including text boxes? Or how to import one Pages document into another Pages document?

    Hi there,
    I am working on my thesis with several Pages documents (for the first time). And I really have searched all over the Internet to find an answer to exactly my question but I cannot find it.
    First my question was: How can I import one Pages document into another one? I found the answer on that (I think) and there is nothing else than just make a new section and copy/paste it in.
    But then another issue pops up: I cannot [cmd]+A my whole document including the texboxes to paste it in the other Pages document. Then the document will be paste without the textboxes (and I have quite a lot of them in that document) and the text will not be at the right place.
    So please explain to me: How I can combine two Pages documents and keep them exactly the way they are? Is that even possible?
    I thank you so much in advance!

    Hi Fruhulda,
    I have already tried to mark the textboxes in line but that did not work, and besides then the text and the boxes won't be at the rigt places either. Thank you for your reply .

  • How do I copy a page from one pdf  document to another?

    I am a newbe!

    That was easy.Thank you.
         Re: How do I copy a page from one pdf document to another?
    created by George Johnson in Creating, Editing & Exporting PDFs - View the full discussion
    If you open both documents, you can drag a page from the Pages panel (on the left of the window) of one document and drop it into the Pages panel of another.
    You can also extract one or more pages from a document to create a new document, and then insert the pages from this new document into another. In Acrobat 11 you 'd do this by doing:
    Tools > Pages > Extract
    and then:
    Tools > Pages > Insert from File
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6163925#6163925
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6163925#6163925
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6163925#6163925. In the Actions box on the right, click the Stop Email Notifications link .
    Start a new discussion in Creating, Editing & Exporting PDFs at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0 .

  • How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    Or using the Adobe PDF Pack https://www.acrobat.com/

  • Duplicating form fields from one PDF document to another

    Hi,
    Does anyone know of a way to select and duplicate all acrobat form fields from one PDF document into a new PDF document. I know I can do so one field at a time but would like to know if there is a way to do so in a wholesale fashion.
    Our PDF documents are created in-house each year and are nearly the same as the previous year's document containing 99% of the same form fields in the same locations. These forms contain a lot of form fields, anywhere from 50 to 100 fields.
    Rather than start from scratch each year defining the same fields that were present in the previous year's document, I am looking for a way to copy the form fields from an existing PDF document (last year's PDF in our case) and copy the form fields into a new PDF document (that does not yet have any form fields defined) and hopefully maintain all the field attributes and positions from the previous years document.
    Thanks for any suggestions,
    Steve

    The PDF template we need to copy the form fields "to" doesn't start out having any form fields. It is the fields that we need copied from a previous year's PDF template.
    Here's an except from my original post: "I am looking for a way to copy the form fields from an existing PDF document (last year's PDF in our case) and copy the form fields into a new PDF document (that does not yet have any form fields defined)"
    The "new" PDF template is a complete "paper" form with updated legal text and calendar year referrences but NO form fields. In our IS group, we then take these forms, add form fields to them and are then able to populate them with database-resident user data. We serve them up to the user in their browser pre-populated with their application data.
    So again, our need is to find a way to copy form fields from "last year's" PDF template and copy just the form fields to an fresh "new year's" PDF template that contains no form fields to begin with. What we begin with is just a PDF representation of a paper student loan application.
    Thanks for the suggestion!

  • I dragged a cut out image from one photoshop document into another and now it is blurry. What to do?

    I dragged a cut out image from one photoshop document into another and now it is blurry. What can I do to prevent this?

    What is the resolution of the image that you "dragged"? The resolution is the number in pixels per inch (ppi). If you dragged a significantly lower resolution file into a higher resolution file, it could result in a blurry image.
    see below:
    For further reading of Key Concepts:
    http://www.adobe.com/designcenter-archive/keyconcepts/articles/concept_resolution.html
    You can determine the image size by choosing Image > Image Size
    below you can see the pixel dimensions of my example image.
    Resolution Basics:
    Adobe TV- http://tv.adobe.com/watch/creative-sweet-tv/photoshop-resolution-basics/
    http://tv.adobe.com/watch/visual-design/getting-started-09-resizing-an-image/
    Adobe Help:
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7945a.h tml
    -janelle

  • Insert One Word Document into another using OLE ABAP

    Hi,
    I want to insert one word document into another Word Document called by OLE ABAP.
    ie.first word document having 6 pages have been displayed and I want first page of
    second document as a 7th page.I want to dispaly the entire data in  one document.
    Hope to get the reply soon.
    Thanks & Regards,
    Divya.

    T.code :- DWDM
    u can check OLE and OFFICE INTEGRATION tree  have so many demo report
    Report :- RSOLETT1
    Edited by: Krupaji on Feb 18, 2010 2:00 PM

  • I want to import one imovie project into another one.  In other words, I have created a short sequence in iMovie 11 on one computer, and I want to import it into a project that I am working on, on another computer.

    I want to import one imovie project into another one.  In other words, I have created a short sequence in iMovie 11 on one computer, and I want to import it into a project that I am working on, on another computer.  I copied the project files onto a hard drive, and then connected that drive to the Mac that my main project is on, but when I select "import" the files are faint gray -meaning I can't select them.  Help!  I want to transfer a sequence of shots from one iMovie 11 project on one computer, into another iMovie 11 project on another computer.

    Tell me it ain't so!
    I wish I could.  The research you've done is correct.
    Wether you copy and paste or rebuild the Project from the other computer, you're going to need to get your Evnets copied from the other computer.
    The Prjoject files only contain pointer back to the original media.
    Matt

  • How do I import a pdf document into Pages?

    How do I import or convert a PDF document into an iMac Pages document?

    Drag and drop.....Open the Pages document, navigate to the .pdf in Finder, grab the .pdf and drop it into the Pages doc. Couldn't be easier. Very simple in a single page document in a multi page .pdf it might be easier to use Automator to grab the individual pages.
    If you want to make the .pdf editable then you will need to get a license of Adobe Acrobat.
    Roger

  • How do I import one iPhoto library into another?

    I have one iPhoto library on my iMac--family photos--and just imported another one from a Mac Mini, which I've called iPhoto (hiking), as it is photos of our hiking trip. I'd like to import everything from the latter into the former, then delete the latter. I tried just dragging the latter in, but instead of merging, it replaced the former. I've fixed that, thanks to Time Machine, but now need to merge my libraries. Any ideas?
    Thanks

    Well I'm not sure what you did but no one else has managed to ever import one Library to another without causing a mess as described above - in fact as you describe yourself:
    It imported the photos and the thumbnails. All I had to do was delete any duplicates and orginize it.
    You also lost any keywords, albums, Faces and Places along the wy. Merging two libraries will not import any thumbnails, there will be no duplicates and you'll have no organising to do.

  • Inserting objects from one PDF document to another in Acrobat XI

    When I copy objects using "Edit Text & Images" and insert it to another document, objects are insert in any place of document, but when document "A" have view "Fit to screen" and document "B" have same view and I copy object from A and insert  to B, object in B will insert to same place (exact) how it was in A. It works fine in Acrobat 9, 10. It didn't work in Acrobat XI (11.0.3). Does any know how to fix it?

    The PDF template we need to copy the form fields "to" doesn't start out having any form fields. It is the fields that we need copied from a previous year's PDF template.
    Here's an except from my original post: "I am looking for a way to copy the form fields from an existing PDF document (last year's PDF in our case) and copy the form fields into a new PDF document (that does not yet have any form fields defined)"
    The "new" PDF template is a complete "paper" form with updated legal text and calendar year referrences but NO form fields. In our IS group, we then take these forms, add form fields to them and are then able to populate them with database-resident user data. We serve them up to the user in their browser pre-populated with their application data.
    So again, our need is to find a way to copy form fields from "last year's" PDF template and copy just the form fields to an fresh "new year's" PDF template that contains no form fields to begin with. What we begin with is just a PDF representation of a paper student loan application.
    Thanks for the suggestion!

  • How can I copy/paste a page from one pages document into another pages document?

    I have read the directions in the manual, but when I go to the document where I want to put the page the paste function is greyed out.  I assume this has something to do with styles, but can't find what to do. 

    You got it.
    Paste is greyed when we try to paste a page from a WP document into the thumbnails area of a Layout one.
    It's active if we try to paste in the pages area.
    In the document's tool bar, there is an icon with a + symbol at top left.
    In WP documents it's named Sections, In Layout ones its named Pages.
    Yvan KOENIG (VALLAURIS, France) mercredi 26 octobre 2011 17:50:55
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How to import one project file into another project file

    In previous versions I could take an 8 track project file and drag it into another project.  This doesn't work in version 10.  I am playing multi track stems for worship.  I create each song as it's own file then drag them together to create a set.  I don't mix down since I want to be able to add or subtract an instrument based on who may or may not be avaiable that day.  Has this feature been taken out of Version 10?  Can you do this in either Logic or Mainstage?
    Thanks

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <xsl:variable name="xml1" select="document('xml1.xml')"/>
    <xsl:variable name="xml2" select="document('xml2.xml')"/>
    <xsl:copy-of select="$xml1"/>
    <xsl:copy-of select="$xml2"/>
    </xsl:template>
    </xsl:stylesheet>

  • Importing a pdf file into another pdf file

    I have a fillable pdf file that I'm editing in Livecycle and wish to add the contents of another PDF file to the end of this one.   Can't figure out how to do this.
    Please help.

    The PDF I am trying to add was not originally created in Livecycle.   It was a Word doc that I just converted to PDF.
    The New Form Assistant lets me know that right off the bat when I open it.   And makes me select one of two options,   either Create an Interactive Form with Fixed Pages or Create an Interactive Form with a Flowable Layout.   I select the first option.  There's nothing that I need to make fillable in this.
    What?  You want me to post both files here on this board?

  • How to insert one XML document into another

    Hi,
    I've been working on a simple CMS.
    There is a main template that is just a HTML page. The main template has a few extra 'module' tags that indicates places where individual modules have to be placed.
    main template: template.xml
    <html>
    <body>
    <div>
    <module id="centre"/>
    </div>
    </body>
    </html>module template: module_centre.xml
    <div>
    <a>This is a MODULE and it may be much more complex</a>
    <div>My application has to detect every 'module' tag from the template.xml and insert there XML content from a proper module template.
    The result file has to be generated dynamically on a request. The structures of 'modules' can be only defined in module_*.xml files.
    The expected result
    <html>
      <body>
        <div>
            <div>
                <a>This is a MODULE and it may be much more complex</a>
            <div>
        </div>
      </body>
    </html>What's the best practice do solve this case?
    Pawel

    I think I've came up with a better solution.
    SRC file
    <?xml version="1.0" encoding="utf-8"?>
    <html>
      <head>
        <title></title>
        <style type="text/css">
    div.c4 {background-color:pink;width:400px;height:50px}
    div.c3 {background-color:green}
    div.c2 {background-color:blue;width:400px;height:299px}
    div.c1 {background-color:red}
    </style>
      </head>
      <body>
      <module id="XXX"/>
        <div id="main" class="c3">
          <div id="top" class="c1"><module id="menu_test"/></div>
          <div id="bottom" class="c2"><module id="menu_test2"/></div>
        </div>
        <div id="footer_container" class="c4">    <module id="menu_footer"/></div>
      </body>
    </html>MODULE src file
    <?xml version="1.0" encoding="UTF-8"?>
    <div id="admin_panel_module" style="background-color:orange;width:200px;height:50px">
        <p>Control Panel TEST</p>
    </div> @param source  -  NODES from MODULE document
    *@param target - TEMPLATE document where MODULES are going to be inserted*
    @throws Exception
    public static void insertModules(Node source, Document target) throws Exception {
    Node importedNodes = target.importNode(source, true);
    // Use XPath to find all 'module' nodes in ''
    XPath xpath = XPathFactory.newInstance().newXPath();
    NodeList nodes = (NodeList) xpath.evaluate("//module", target, XPathConstants.NODESET);
    // Remove MODULE node and insert there an XML content from MODULE template
    for (int idx = 0; idx < nodes.getLength(); idx++) {
    Node editedModuleElement = nodes.item(idx);
    // parent of module mode
    Node parentNode = editedModuleElement.getParentNode();
    // replace <module/> node with imported nodes from 'module' XML document
    parentNode.replaceChild(importedNodes, editedModuleElement);
    // nodes.item(idx).appendChild(node);
    importedNodes = target.importNode(source, true);
    }Edited by: maestr0 on May 24, 2010 12:44 AM

Maybe you are looking for

  • Can't move files - white circle with white line through it?

    OsX 10:4:10 Suddenly I cannot move files from one drive to another, or from drive to desktop. Recently updated everything. White circle with white line through it appears. Network awaiting news footage. I'm stuck. What might this be? Any help would b

  • Reboot script doesn't work with BOOTCD

    Hi, We do Image our Workstations with the BOOTCD which works fine. At the End, there's a reboot command. All worked out, we had to do some changes in the Scripts after upgrading to ZEN7, but now the Reboot doesn't work anymore, the Workstation just w

  • How to use JDBC driver (type 4) with struts?????

    Hi! have a nice day!!!!! i want to connect database use struts with JDBC driver type 4. i must add <data-source/> to <data-sources></data-sources> tag but i don't know how to use <data-source/> with it's properties. please tell me! thank very much

  • ORA - 302000 ??? Why ? (Forms 4.5)

    Can anyone help me to understand this error ?

  • Dispacher and server0 is not started during NW2004s installation

    Hi, Dispacher and server0 is not started during NW2004s installation. SAPInst is stopped on the step of the 'Start java instance'. SDM is 'running' but dispacher and server0 is 'Starting framwork'. So I configured the some parameters via configtool b