Bookmark export does not list/export single first-level bookmark
xelan opened this issue · comments
Andreas Erhard commented
Bookmark export does not list/export single first-level bookmark
Please ensure the following:
- Your issue is based on the latest commit
Tested with:
pdfcpu: v0.7.0 dev
commit: f783bf23 (2024-04-15T12:17:46Z)
base : go1.22.1
pdfcpu: v0.8.0 dev
commit: 576f15e (2024-04-24T22:27:04Z)
base : go1.22.0
- State your OS and OS version
Debian 11, Debian 12
For PDFs with only one first-level bookmark, that bookmark is not shown in list/export. However, it's descendants are included in the export.
pdfcpu bookmarks export example2.pdf && cat out.json
Expected:
{
"header": {
"source": "example2.pdf",
"version": "pdfcpu v0.8.0 dev",
"creation": "2024-04-29 13:16:12 CEST",
"author": "Jane Doe",
"creator": "Example Creator",
"producer": "Example Producer"
},
"bookmarks": [
{
"title": "Awesome PDF",
"page": 1,
"kids": [
{
"title": "Section 1",
"page": 1
},
{
"title": "Section 2",
"page": 1
}
]
}
]
}
Actual:
{
"header": {
"source": "example2.pdf",
"version": "pdfcpu v0.8.0 dev",
"creation": "2024-04-29 13:16:12 CEST",
"author": "Jane Doe",
"creator": "Example Creator",
"producer": "Example Producer"
},
"bookmarks": [
{
"title": "Section 1",
"page": 1
},
{
"title": "Section 2",
"page": 1
}
]
}
Another testfile with one first-level bookmark (which is omitted by pdfcpu bookmarks export
)
bookmarks-only-h1.pdf
Thank you very much for investigating this issue😊
Horst Rutter commented
The behaviour of this was based on Apple Preview's, now it is based on Acrobat Reader's.
Fixed with latest commit!
Andreas Erhard commented
Thank you very much for the quick fix!
Horst Rutter commented
👍