Hi there,
at the moment it is possible to copy the bookmarks/contents-structure and to paste it into another document. I would also like to have the option to copy this structure as simple text to the clipboard in order to paste it into another application (text-document or my reference management software for instance). Can this be realised?
Thanks
Ludwig
Feature Request: Copy bookmarks/contents as text
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
- Ivan - Tracker Software
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Feature Request: Copy bookmarks/contents as text
Hi Ludwig,
it easily can be done using simple JavaScript (see below; it is taken from PDF JS Reference). When your document is active, open the JavaScript console (press Ctrl+J shortcut), paste the proposed JS code in the console and run it (using corresponding button on the toolbar). When script is finished, you will have a dump of all your boomarks in a plane text, and can select it, copy and use whenever you need.
HTH
it easily can be done using simple JavaScript (see below; it is taken from PDF JS Reference). When your document is active, open the JavaScript console (press Ctrl+J shortcut), paste the proposed JS code in the console and run it (using corresponding button on the toolbar). When script is finished, you will have a dump of all your boomarks in a plane text, and can select it, copy and use whenever you need.
HTH
Code: Select all
function DumpBookmark(bkm, nLevel)
{
var s = "";
for (var i = 0; i < nLevel; i++) s += " ";
console.println(s + "+-" + bkm.name);
if (bkm.children != null)
for (var i = 0; i < bkm.children.length; i++)
DumpBookmark(bkm.children[i], nLevel + 1);
}
console.clear(); console.show();
console.println("Dumping all bookmarks in the document.");
DumpBookmark(this.bookmarkRoot, 0);
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Re: Feature Request: Copy bookmarks/contents as text
Works great - thanks a lot!
- Will - Tracker Supp
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
- Location: London, UK
- Contact:
Re: Feature Request: Copy bookmarks/contents as text
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Re: Feature Request: Copy bookmarks/contents as text
in the same way is there any code to copy each line of text file as bookmark in pdf file.
for each line there should be one bookmark in pdf.
thanks a lot in advance.
for each line there should be one bookmark in pdf.
thanks a lot in advance.
- Will - Tracker Supp
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
- Location: London, UK
- Contact:
Re: Feature Request: Copy bookmarks/contents as text
Hi kotlmg,
I don't personally believe that this is possible, programatically, but I will ask one of the Developers to weigh in, as they would know far than myself.
It's about 11pm (Sunday) for them, so it will be a few hours until they are able to comment.
Cheers,
I don't personally believe that this is possible, programatically, but I will ask one of the Developers to weigh in, as they would know far than myself.
It's about 11pm (Sunday) for them, so it will be a few hours until they are able to comment.
Cheers,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
- Ivan - Tracker Software
- Site Admin
- Posts: 3550
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Re: Feature Request: Copy bookmarks/contents as text
JavaScript in PDF has no access to external files, so, it cannot read external text file.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.