Summary: | Some pages are removed by pdfwrite when merging PDF files | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Olivier DEPALLE <odepalle> |
Component: | PDF Writer | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 8.64 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Customer: | Word Size: | --- |
Description
Olivier DEPALLE
2010-01-20 01:40:27 UTC
You haven't supplied any example files to look at. What do you mean when you say that 'pages are removed' ? Is the page count after merging not the same as the total number of pages in each file (in your example, 72 pages)? You appear in fact to be complaining that the bookmarks are not correct after merging two files together. This is to be expected. Bookmarks are stored separately to the page content and reference pages in the PDF file directly, if you modify the page order (by inserting extra pages in front for example, as you have here) then the page number references will no longer be correct. The merged file is good, the bookmarks are not. In fact, the bookmarks are bad: - they are OK for the 4 first pages (first document) - they are KO for the next pages (second document): the first bookmark links to the first page of the merged file, not to the 5th... That's to be expected. The bookmarks in your second file reference pages 1 to 68, however those pages are now (in the merged file) at locations 5 to 72. As a result the bookmarks are incorrect. Ghostscript and the pdfwrite device don't actually have any way to know that you've merged two files together, all the pdfwrite device knows is that its been given 72 pages to process, and a bunch of pdfmark operations referencing those pages. pdfwrite doesn't know that you have moved some of the pages, and so is unable to correct the pdfmark references, thus the bookmarks are created pointing at different pages. Is there a way to recreate these bookmarks correctly before merging the files? Ken's comment 3 is not entirely correct - this bug is actually the same as bug 688829 , for which an operational patch exists, but not accepted due to stylistic reasons. I intend to go back to it one day. The reporter is free to apply the patch himself. |