Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy Table of Contents from one PDF to another

You might find it as duplicate of Create a table of contents from a pdf file, but I didn't get any solution there. My scenario is like I am creating a PDF from existing PDF with some edits. That all works fine. My question is I want to add metadata, table of contents, bookmarks, what ever you call that is in metadata of PDF to the newly created PDF. I am not able to understand XMP format as suggested in How to add the metadata to a pdf in Objective C?. Is there any way I can directly add TOC to new PDF?

I am using following function but it is not working at all.

CGPDFContextAddDocumentMetadata(pdfContext, contdata);

Can anyone suggest me the direction to dig in? Any 3rd party tool will also do. I tried podofo but I'm not getting any way for porting it in iOS.

like image 956
DivineDesert Avatar asked Nov 14 '11 13:11

DivineDesert


People also ask

How to copy a table from a PDF to Microsoft Word?

As you can see, it is fairly simple to copy your table from a PDF file to Microsoft Word. The easiest solution is to open the PDF with your Word, which will automatically convert it for you.

How to copy and paste content from a PDF file?

How to Copy and Paste Content from a PDF File 1 Open Acrobat Reader. 2 Open a PDF file. 3 Click Edit. 4 Click Select All. 5 Click Edit again, then click Copy. 6 Open a new document. 7 Paste in the copied text. See More....

How do I copy a large file from a PDF?

If you want to copy large content from a PDF, you can easily export the PDF to Word, Excel, or PowerPoint. Right-click the document, and choose Document Properties. Click the Security tab, and review the Document Restrictions Summary. Right-click the document, and choose Select Tool from the pop-up menu.

Is it possible to copy a table to another file?

However, if you use the Edit Text & Images tool you should be able to select the entire table and copy it to another file. Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more Thanks, but that is exactly what I'm doing : (.


2 Answers

The XMP metadata and TOC/bookmarks are 2 different things. While the TOC in a PDF file can be read using the CGPDF* functions, it cannot be duplicated in another PDF file because the CGPDF* API does not let you create PDF objects and insert them in a PDF file.

like image 87
iPDFdev Avatar answered Oct 06 '22 00:10

iPDFdev


I recently did a lot of merging pdf's together and also populating form data. I would check out PDF Toolkit as it really helped me out. You can execute it from within your code.

like image 26
Cymbals Avatar answered Oct 05 '22 23:10

Cymbals