• 2 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use an existing CSV file to add bookmarks to a PDF
#1
Many PDF readers support clickable bookmarks. This is very helpful to navigate to a certain song when you use a PDF fakebook outside MSP.

   

If you already have a CSV file for a certain PDF file you can easily use it as input to add bookmarks to the PDF.

Before you start
---
- make sure that the required programs are available
  LibreOffice Calc is used to prepare the bookmarks file
  jPDFBookmarks is used to add the bookmarks list to the PDF
  https://sourceforge.net/projects/jpdfbookmarks/files/
  both are available for free and should be usable on various platforms
  I did the following on Win10
- make backup copies of the CSV file and PDF file (just in case)

Convert the CSV file to a bookmarks file
---
- open the CSV file with LibreOffice Calc
  select the correct encoding and separator
- delete all columns except TITLE and PAGES  
- delete the column header line
- delete other unnecessary lines if required
  (e.g. CSV files that were posted by me often contain a line that refers to the complete book)
- edit PAGES of multi page songs so that only the start page remains
  e.g. edit "9-11" or "9,10,11" to "9"
- sort the lines by PAGES or by TITLE as you like to see the bookmarks in the resulting PDF
- save the edited file as "bookmarks file"
  File > Save As... (Datei > Speichern unter ...)
  choose "File Type" (Dateityp) "CSV"
  uncheck "Automatic file name extension" (Automatische Dateiendung)
  check "Edit filter settings" (Filtereinstellungen bearbeiten)
  specify the filename for the bookmarks file, use .txt as file extension
- as soon as you click "Save" (Speichern), the window "Export Text File" (Textdatei exportieren) opens
  select "Character set:" (Zeichensatz) "Western Europe (ISO-8859-1)" (Westeuropäisch (ISO-8859-1))
  set "Field delimiter:" (Feldtrenner) to "/" (without the quotes)
  click OK
 
Create bookmarks with jPDFBookmarks
---
- open the PDF with
  File > Open ...
- open the bookmarks file created as above with
  Tools > Load
- save PDF with bookmarks with
  File > Save as ...
  choose a new name, e.g. add -bookmark to the original filename
- check the result
  I used the default settings of jPDFBookmarks for a minimalistic approach.
  Clicking a bookmark jumps to the top of the given page and scales that page to the width of the current window.
  You might have to scroll down to find the song you are looking for.
 
Example
---  
I used "Kinder wollen singen" as an example to find out how bookmarks can be created easily.
See https://www.zubersoft.com/mobilesheets/f...&pid=24797
You can find a sample bookmarks file there


Attached Files Thumbnail(s)
   
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#2
Great write-up, I stickied it so people can easily reference it.
Reply
#3
Thank you very much for writing this tutorial! For jPDFBookmarks, I only found a windows version until now, so it seems that the tutorial is limited to that OS for the moment - or did I miss something?
Reply
#4
jPDFBookmarks is a Java application. So I assume it should be possible to run it under a Java environment on a different OS. But I admit that is just an assumption. I tried it only on Win10.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#5
I have tried using the MSP Share function to create a PDF file with bookmarks from an "Album" I have previously imported into MSP with a CSV file.  It works but only for a small number of songs - maybe 10 or so. When I tried to share an album containing 100 songs the operation failed.  If MSP wouldn't choke on such an export function it would simplify producing a PDF file with bookmarks.
Reply
#6
There is currenty a bug if you export and enable the "Join into one PDF" option. I have a fix in place for that that will be included with the next update. One workaround is disable the exporting of cropping, as this avoids the bug. There is another bug in the Windows 10 version that can cause crashing while exporting that I have also fixed. I still have a few issues to investigate and potentially fix, but then I'll release the update once things are ready.

Mike
Reply
#7
I was using the Win10 version. Thanks for the response.
Reply
#8
(03-24-2019, 06:47 PM)itsme Wrote: Many PDF readers support clickable bookmarks. This is very helpful to navigate to a certain song when you use a PDF fakebook outside MSP.



If you already have a CSV file for a certain PDF file you can easily use it as input to add bookmarks to the PDF.

Before you start
---
- make sure that the required programs are available
  LibreOffice Calc is used to prepare the bookmarks file
  jPDFBookmarks is used to add the bookmarks list to the PDF
  https://sourceforge.net/projects/jpdfbookmarks/files/
  both are available for free and should be usable on various platforms
  I did the following on Win10
- make backup copies of the CSV file and PDF file (just in case)

Convert the CSV file to a bookmarks file
---
- open the CSV file with LibreOffice Calc
  select the correct encoding and separator
- delete all columns except TITLE and PAGES  
- delete the column header line
- delete other unnecessary lines if required
  (e.g. CSV files that were posted by me often contain a line that refers to the complete book)
- edit PAGES of multi page songs so that only the start page remains
  e.g. edit "9-11" or "9,10,11" to "9"
- sort the lines by PAGES or by TITLE as you like to see the bookmarks in the resulting PDF
- save the edited file as "bookmarks file"
  File > Save As... (Datei > Speichern unter ...)
  choose "File Type" (Dateityp) "CSV"
  uncheck "Automatic file name extension" (Automatische Dateiendung)
  check "Edit filter settings" (Filtereinstellungen bearbeiten)
  specify the filename for the bookmarks file, use .txt as file extension
- as soon as you click "Save" (Speichern), the window "Export Text File" (Textdatei exportieren) opens
  select "Character set:" (Zeichensatz) "Western Europe (ISO-8859-1)" (Westeuropäisch (ISO-8859-1))
  set "Field delimiter:" (Feldtrenner) to "/" (without the quotes)
  click OK
 
Create bookmarks with jPDFBookmarks
---
- open the PDF with
  File > Open ...
- open the bookmarks file created as above with
  Tools > Load
- save PDF with bookmarks with
  File > Save as ...
  choose a new name, e.g. add -bookmark to the original filename
- check the result
  I used the default settings of jPDFBookmarks for a minimalistic approach.
  Clicking a bookmark jumps to the top of the given page and scales that page to the width of the current window.
  You might have to scroll down to find the song you are looking for.
 
Example
---  
I used "Kinder wollen singen" as an example to find out how bookmarks can be created easily.
See https://www.zubersoft.com/mobilesheets/f...&pid=24797
You can find a sample bookmarks file there
This is immensely helpful! Thank you. I'm trying to avoid using yet another application (LibreOffice) to get there. Looking at your list of LibreOffice edits (which I've italicized sections of below), I have a couple questions that will help me use my existing software (that I'm already using to create the CSV file for MobileSheets import) instead:
. . .
  select the correct encoding and separator   - my software uses the semi-colon but I can change it to the forward slash if that's necessary for this purpose, but what do I need to know about the "correct encoding"? I should note that my software is German, so I presume it's defaulting to an encoding that works there.
. . .
- edit PAGES of multi page songs so that only the start page remains  - my software exports a separate field for this
  e.g. edit "9-11" or "9,10,11" to "9"
- sort the lines by PAGES or by TITLE as you like to see the bookmarks in the resulting PDF  - no problem for me
. . .
 select "Character set:" (Zeichensatz) "Western Europe (ISO-8859-1)" (Westeuropäisch (ISO-8859-1))  - what default encodings could hurt me?
. . .


Thanks! The rest looks pretty easy with JpdfBookmarks, which I've already downloaded and can run on a desktop that has Java Runtime installed already. Will I need to worry about updates to the Jave Runtime breaking JpdfBookmarks?
- Kevin
Reply
#9
There's an issue with the created bookmarks in SUmatra PDF, see https://zubersoft.com/mobilesheets/forum...p?tid=7106
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.