{"id":753,"date":"2015-11-09T17:10:18","date_gmt":"2015-11-09T17:10:18","guid":{"rendered":"http:\/\/malemuk.com\/olofee\/?p=753"},"modified":"2016-12-12T14:20:59","modified_gmt":"2016-12-12T14:20:59","slug":"create-bookmarks-in-pdf","status":"publish","type":"post","link":"http:\/\/malemuk.com\/olofee\/create-bookmarks-in-pdf\/","title":{"rendered":"pdftk tips"},"content":{"rendered":"<h3>Number pages<\/h3>\n<p>Source:\u00a0<a href=\"http:\/\/cazencott.info\/index.php\/post\/2015\/04\/30\/Numbering-PDF-Pages\">http:\/\/cazencott.info\/index.php\/post\/2015\/04\/30\/Numbering-PDF-Pages<\/a><\/p>\n<p>Create a PDF that contains only page numbers. In numbers.tex:<\/p>\n<pre>\\documentclass[12pt,a4paper]{article}\r\n\\usepackage{multido}\r\n\\usepackage[hmargin=.8cm,vmargin=1.5cm,nohead,nofoot]{geometry}\r\n\\begin{document}\r\n\\multido{}{31}{\\vphantom{x}\\newpage}\r\n\\end{document}<\/pre>\n<p>(where 31 is your total number of pages). Then create numbers.pdf<\/p>\n<pre>pdflatex numbers.tex<\/pre>\n<p>Finally, stamp your file with page numbers:<\/p>\n<pre>pdftk file.pdf multistamp numbers.pdf output single_document_numbered.pdf<\/pre>\n<h3>Create bookmarks<\/h3>\n<p>Instructions for pdftk on Linux. May work on Windows.<\/p>\n<p>Dump the metadata<\/p>\n<pre>pdftk input.pdf dump_data &gt; metadata.txt<\/pre>\n<p>Write your bookmarks under the line starting with &#8220;NumberOfPages&#8221;:<\/p>\n<pre>BookmarkBegin\r\nBookmarkTitle: My bookmark\r\nBookmarkLevel: 1\r\nBookmarkPageNumber: 34<\/pre>\n<p>Then update the metadata of the original file<\/p>\n<pre>pdftk input.pdf update_info_utf8 new_metadata.txt output temp.pdf<\/pre>\n<p>Finally, in order to avoid losing your zoom level whenever you click a bookmark<\/p>\n<pre>sed 's#\/Fit#\/XYZ#g' temp.pdf &gt; output.pdf<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Number pages Source:\u00a0http:\/\/cazencott.info\/index.php\/post\/2015\/04\/30\/Numbering-PDF-Pages Create a PDF that contains only page numbers. In numbers.tex: \\documentclass[12pt,a4paper]{article} \\usepackage{multido} \\usepackage[hmargin=.8cm,vmargin=1.5cm,nohead,nofoot]{geometry} \\begin{document} \\multido{}{31}{\\vphantom{x}\\newpage} \\end{document} (where 31 is your total number of pages). Then create numbers.pdf pdflatex numbers.tex Finally, stamp your file with page numbers: pdftk file.pdf multistamp numbers.pdf output single_document_numbered.pdf Create bookmarks Instructions for pdftk on Linux. May work on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-753","post","type-post","status-publish","format-standard","hentry","category-computer-stuff"],"jetpack-related-posts":[{"id":910,"url":"http:\/\/malemuk.com\/olofee\/emacs-tips\/","url_meta":{"origin":753,"position":0},"title":"Emacs tips","date":"December 31, 2015","format":false,"excerpt":"Essential shortcuts M-: META key (ALT on most keyboards) C-: CONTROL key C-x C-f : open file C-x b : switch to buffer C-x k : kill buffer C-s : search text forward C-r : search text backward C-+ \/ C-- : Zoom in\/out C-space: mark set (start of the\u2026","rel":"nofollow","context":"In \"Computer stuff\"","img":{"src":"","width":0,"height":0},"classes":[]},{"id":886,"url":"http:\/\/malemuk.com\/olofee\/coastal-sea-ice-action-on-a-breakwater-in-a-microtidal-inlet-in-svalbard-phd\/","url_meta":{"origin":753,"position":1},"title":"Coastal-sea-ice action on a breakwater in a microtidal inlet in Svalbard (PhD)","date":"December 31, 2015","format":false,"excerpt":"PhD Thesis (PDF) Abstract Preface LaTeX source code of the thesis Writing statistics Defence Trial lecture Defence video Defence slideshow Defence slideshow with notes Questions from the opponents Articles 19th IAHR International Symposium on Ice (2008) Caline, F. and Barrault, S., 2008, Transmission of level ice stresses to the ice\u2026","rel":"nofollow","context":"In \"PhD\"","img":{"src":"","width":0,"height":0},"classes":[]},{"id":2890,"url":"http:\/\/malemuk.com\/olofee\/atomic-kola\/","url_meta":{"origin":753,"position":2},"title":"Atomic Kola","date":"November 27, 2017","format":false,"excerpt":"This working document gathers information about the Kola peninsula nuclear power plants. Some of the links are in Norwegian. In the news Farlig atomkraftverk driftes videre (NRK Nordnytt, 27.06.2014) Other NRK articles Other Video by the NGO Natur & Ungdom: Atomkraft i Nabobygda Skriftlig sp\u00f8rsm\u00e5l fra Peter Skovholt Gitmark (H)\u2026","rel":"nofollow","context":"In \"Politics and Society\"","img":{"src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/posts\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":7,"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":2685,"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/posts\/753\/revisions\/2685"}],"wp:attachment":[{"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/media?parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/categories?post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/malemuk.com\/olofee\/wp-json\/wp\/v2\/tags?post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}