Saturday, 6 February 2016

SVG-Tools

SVG-Tools


SVG-Tools is a set of small LibreOffice / OpenOffice .odt files with Macros that can batch process SVG-Files.

The main purpose is to prepare and process SVGs for usage in LibreOffice.
see LOSA : LibreOfficeSongbookArchitect

Some Tools for altering SVG's from Musescore, some are for all kinds of SVGs.

Download: SVG_Tools.zip

  1. Musescore Staffline ColorSizer for Musescore 2.0.2
    Change colors and widths of Stafflines, ledger lines, Tablature strings, Guitar Diagram strings and frets of SVG's exported by Musescore.




  2. Musescore SVG Splitter for Musescore 2.0.2 (and 2.0.3)
    Split Musescore's Multipage SVG's into single SVG's. Auto-detection of Number of Pages for DinA4 and Letter. 
    (Though 2.0.3 is supported the SVG files from it have a scaling bug. Your score must be at default Staff scaling and grace notes etc. will be at wrong scale)


  3. SVG BlackColorChanger
    Change the color of all black elements in SVG's.
    (May be useful for "prepress")



  4. SVG Rotate
    Rotate SVG's  90°Left, 180° or 90°Right.
    (If you try to rotate an imported SVG with LO-Writer's builtin rotate-command you get a raster image as result. We don't want that :-)



Saturday, 25 April 2015

LibreOfficeSongbookArchitect


LibreOfficeSongbookArchitect
(LOSA)


Download this page as PDF:
LOSongbookArchitect-Documentation.pdf

Intro

LibreOfficeSongbookArchitect(LOSA) is a LibreOffice/OpenOffice Document with embedded Macro and Toolbar that helps you to create a PDF with page numbers, clickable Table-of-Contents (TOC) and PDF-Bookmarks in an easy and comfortable way. Being a LibreOffice document it provides full control over page-layout.

The reason I started this project was the wish to create a songbook out of my music scores in PDF or SVG format. Software like Adobe InDesign or Adobe Acrobat is out of my budget and I found 2 cheaper programs with great PDF import filters: Magix/Xara Photo&Graphic Designer and Serif Page Plus. But Magix/Xara's software isn't capable to create an automatic Table-of-Contents and Serif's is a huge install about 1GB. I decided to go for free and possibly small software to be able to work on any computer without having to manage license accounts etc.
Scribus was said to have great pdf export features. That is true for print but it can't create a clickable Table-of-Contents automatically and PDF-Bookmarks at all like LibreOffice.
(Actually Scribus 1.5 is great, and if you want to generate a press-ready PDF you can open the LOSA-created PDF in Scribus with all the TOC-links intact. Much easier than creating such a PDF from scratch in Scribus alone)
  With LaTex that is all possible but one really has to like to work with code. And to get the layout YOU want one has to investigate quite much
With LibreOffice already being installed as Office software anyway why not try it?

Features

  • Import folders of scores in image format and automatically create "invisible" headings from foldernames that show up only in the Table-of-Contents and as PDF-Bookmarks.
  • Import PDF-files (optional with Bookmarks) and automatically create "invisible" headings from filenames as placemarkers (and from Bookmarks) that show up only in the Table-of-Contents and as PDF-Bookmarks. Automatically merge these PDF-files into the final PDF. (needs PDFtk)
  • Easily insert "invisible" subheadings for any PDF-page or imagescore-page that show up only in the Table-of-Contents and as PDF-Bookmarks.
  • Convert PDFs to svg-image format. Either on import or when already present in the document. (needs Inkscape+PDFtk or Inkscape+Poppler or Poppler)
  • Insert multiple illustrations in image format in one go with:
    • Automatic optimization of svg-illustrations exported by Sibelius. (Correction of viewbox, deleting unused stuff, reducing file size).
    • Automatic conversion of 1-page PDF- and EPS-Files to SVG (Needs Inkscape)
  • eps/pdf2svg-converter: Convert folder of eps-files and 1-page-pdf-files to SVG-Files. (Needs Inkscape and for eps also Ghostscript. see (http://clownfishcafe.blogspot.de/2014/05/importing-eps-files-into-inkscape.html))
  • SVG-fonts2paths: Convert folder of SVG-Files.(Needs Inkscape)
  • PicTool: Change independently Name, Size, Colors, Cropping, Anchor, Alignment, TextWrap, FrameStyle of (or delete) a single, all or all images within a selection (optional filtered by name or FrameStyle or skipped by pattern) at once.
    Also standalone PicTool extension available:
  • SVG-Rotate: Tool for rotating SVG-images. (On selected SVG-image in document or batch-convert SVG-Files in Folder)
  • PDFedit: Tool for splitting and rotating pages of an imported PDF. (needs PDFtk)
  • PDF-attachments to the whole PDF and/or to individual PDF-pages. (needs PDFtk)
  • PDF stamp and/or background, 1-page or even multipage-PDF stamps/backgrounds (needs PDFtk)
  • PDF Security Settings (to be used instead of LibreOffice builtin Settings when using PDFtk-features like pdf import and merging) (needs PDFtk)
  • ChordTransposer (a text tool): Transpose Chords and notes of a selected text passage to different key signatures and Capo places. Also standalone ChordTransposer extension available:
  • PDFmerger(needs PDFtk)

What you need

  1. LibreOffice Writer 4.4.7.2 (https://www.libreoffice.org/) (~200 MB) or OpenOffice 4.1.2
    As long as LibreOffice 5 has too many bugs get LibreOffice Version 4.4.7.2 here:
    http://downloadarchive.documentfoundation.org/libreoffice/old/
  2. The LOSongbookArchitect.odt-document (~69 kb): LOSongbookArchitect.zip
Optional:
  1. PDFtk (https://www.pdflabs.com/) (~3-16 MB)
    Pdf-Labs offers 3 versions of PDFtk: PDFtk free, PDFtk Pro and PDFtk Server. All versions include the needed command-line tool for free.

  2. Inkscape (https://inkscape.org/) (~42 MB). (for eps conversion install also Ghostscript (http://www.ghostscript.com/download/)
  3. Poppler. Windows (http://blog.alivate.com.au/poppler-windows/) (~5 MB), Linux(Ubuntu): "sudo apt-get install poppler-utils", OSX: find out yourself ;-)
(Inkscape needs the fonts installed of the PDF that you want to convert. Poppler can use the embedded fonts of the PDF.)
All the programs are available for Windows, Linux and Mac OSX. LOSA is tested on Windows7/10 and Linux (Lubuntu) and should also work on OSX (please test and tell me). LOSA tests on what system it runs and if PDFtk, Inkscape and Poppler are installed, but there could be misinterpretations.


First Start

RULE#1:
If your computer-username contains spaces or special characters best place LOSA in a place without special characters and spaces in the path! This will make sure the external programs PDFtk, Inkscape and Poppler work correctly.
RULE#2:
Turn off LibreOffice' "View PDF after export". Go to: File->Export as PDF->General->untick "View PDF after export". Then "Export", then "Cancel". Now the setting is stored. LOSA will ask you by itself if you want to view the PDF after export (using the "Out"-Button)
RULE#3: 
Enable the execution of macros. Go to "Tools"►"Options"►"LibreOffice"►"Security"►"Macro Security". Set it to "Medium" or "Low". Restart LibreOffice.

Prepare a folder somewhere on your HD and put images of your score inside. Every page a file. (From e.g. Sibelius you can export your score to graphic files like SVG and let it create a folder for the files.)
  1. Open LOSongbookArchitect.odt (in Folder "LOSongbookArchitect")
    N
    ow click on Button "In", select an image file from inside the prepared folder and click open.
  2. Click on Button "Out" and see your result.
Prepare some smaller illustrations in image format and put them somewhere on your HD. (In e.g. Sibelius you can make a graphic selection and export that to SVG.)
  1. In LOSongbookArchitect.odt click on Button "ill", select the illustration image and click open.
  2. Click on Button "Out" and see your result.
  3. Have a look what happend in Folder "LOSongbookArchitect". 
For working with PDFs download and install PDFtk, then: 
  1. click on button "In", select a PDF.
  2. click on button "Out" and see your result.
  3. Look into the folder "source". Put some more PDFs into it. 
  4. click "In", click "Out" et voilà

The Toolbar



The Toolbar consists of 3 "View" buttons, 3 "Process" buttons and 6 "Tools" buttons (and some hidden buttons). From left to right:
  1. Print-Layout/Web-Layout View Switch

    This is a switch between the 2 built-in view modes of LibreOffice. It is convenient to work in Web-Layout as it is a 1-page view mode where you can see all the paragraphs at a glance regardless of page breaks. So it is essentially a 1-page structure view of your document.
  2. Images On/Off

    When working with many images on slower computers or when in Web-Layout-Mode it may be convenient to turn off images. (doesn't affect PDF-Export)
  3. HiddenHeadings On/Off

    Hide and unhide the HiddenHeadings for your image and PDF-scores. (doesn't affect PDF-Export, HiddenHeadings will always be hidden in the result PDF).

    This is useful when you position graphic objects over your score.
  4. In

    Pressing this button will import all Folders of Images and (if PDFtk is installed) PDFs contained in a subfolder called "source". Only new items that are not already present in your document will be imported. If there are no new files then you get a filepicker to pick a PDFfile or a Folder of Images which will be copied to your "source" folder. (To choose a Folder of Images please navigate into the folder and pick an image file. The WHOLE Folder will be inserted!!) The items will be placed either at the end of your document or if you have the cursor on a "HiddenHeading" then before that. Images will have the FrameStyle "score" applied.
    Hint: You can exclude any file or folder from automatic import by
    having its name start with "!." (without the quotes).
    Folders of Images: For every folder a heading (paragraph style "HiddenHeading") will be created and for every image a paragraph with page break (paragraph style "PICFolderFilename") with the image name and the image itself. Images will have the FrameStyle "score" applied.
    Example: Folder "Bach Sonate" with images "BachSon1.svg", "BachSon2.svg"
    Text
    with Paragraph Style:

    Bach Sonate
    Bach Sonate/BachSon1.svg
    Bach Sonate/BachSon2.svg
    HiddenHeading
    PICFolderFilename
    PICFolderFilename
    This entry will go into the Table-of-Contents and the PDF-Bookmarks.
    foldername/filename, IMAGE
    foldername/filename, IMAGE

    PDFs (when PDFtk is installed): For every PDF a heading will be created and for every page of the PDF a paragraph with page break. 2 different paragraph styles are used for this called "HiddenHeading" and "PDFfilenname".
    Example: PDF "I-have-3-pages.pdf"
    Text
    with Paragraph Style:

    I-have-3-pages
    I-have-3-pages.pdf

    HiddenHeading
    PDFfilename
    PDFfilename
    PDFfilename
    This entry will go into the Table-of-Contents and the PDF-Bookmarks.
    The first "page"-paragraph holds the filename.
    Every further "page"-paragraph must be empty.

    If your importPDF has Bookmarks these will also imported (if enabled in the "Prefs") and the structure will be more complex. Every imported Bookmark gets a Paragraph-Style "HiddenHeading+levelnumber" applied. 7 different Levels are supported.
    You can edit the text of "HiddenHeading" as you like, but don't change the text of "PDFfilename" without reason.
    To change the order of the headings best use LibreOffice's Navigator. There select the heading and shift it up or down by using the up/down arrow buttons. (If you turn on "Contents View" then you can drag'n drop.)
    Change the TOC-Level by using the left/right arrow buttons.

    Convert PDFs to SVG-images:
    If you have Inkscape+PDFtk or Inkscape+Poppler or only Poppler installed you get the choice to convert a PDF to SVGs by pressing the "In"-button. Either when picking a file to import or if you have the cursor on a "PDFfilename" in your document. In the last case the PDF will converted and replaced by the SVGs.
    Limitation: For this feature to work the path to your "source" folder must not contain spaces! (only if your computer-username contains spaces or special characters)

  5. ill

    Import images:
    This button is similar to "In" but for inserting illustrations in image format at the cursor position or if the cursor is on a "HiddenHeading" then before that. Pressing it will at first search a folder called "!.illustrations" that is placed in the "source" folder and insert all new files that are not already present in the document. If there are no new files then you get a filepicker to choose an image which then will be copied to the "!.illustrations"-folder and inserted into the document. Images will have the FrameStyle "illustration" applied.Hint: You can exclude any file from automatic import by having its name start with "!." (without the quotes).

    Edit image:
     If you have an image selected then clicking the "ill" button will ask you if you want to edit the image in an external application. A copy of the original image will be automatically created in a subfolder called "original". Works also correctly on linked svg images (opposed to LibreOffice's context menu which will open a png-copy). In OpenOffice it works only on linked images.
    For linked images you will be asked if you want to update it. Click ok after you have saved your edited file. 

    With Inkscape installed: 1-Page PDF- and EPS-Files will automatically converted to SVG-Files. The original PDF and EPS will be moved to a subfolder called "originalepspdf". (If you don't want that you can turn off Inkscape in the Prefs)
    For Sibelius Users: LOSA has a builtin converter and optimizer for the SVG-files from Sibelius that come from graphic selection. The viewbox of these SVGs will be corrected and all the (originally only masked) unused stuff will be deleted. This results in much smaller SVGs. On import LOSA will name these converted files with "_viewbox.svg" attached and the original file will be moved into a folder called "original" inside the "!.illustrations" folder.




  6. Out

    This button will update all indexes like Table-of-Contents (if enabled in the Prefs), hide the "HiddenHeading"s and create the final PDF. You will be asked for a name and if you want to view it in your default PDF viewer.
  7. PicTool

    Set independently Name, Size, Colors, Cropping, Anchor, Alignment, TextWrap, FrameStyle, protection and printability of (or delete) a single selected image, all images within a selection or all images (if nothing selected). Images can be filtered by name, FrameStyle and skipped by repeated pattern: 1 means "do", 0 or any other number "skip". For example 001 means only process every 3rd image. (Note: For proper skipping you have to reload the document if you manually changed the order of the images). Images can also be resized only down or only up to new Size by using "up/down"-CheckBoxes. For example "down" means only scale down images that are greater than the new Size.
    Hint: If you have nothing selected all images will be changed: Also images in Header, Footer, Footnotes and Endnotes. To exclude these use a selection range. A selection range only affects images in the normal text area and ignores images in Header, Footer, Footnotes and Endnotes. So if you want to change all images but these simply select all (ctrl+a).
    If you have selected a textframe all images inside will be affected. To affect textframes instead of images select "Change Frames!" checkbox.
        You can always see how many images or textframes are selected in the Titlebar and which images or textframes are selected if you click on the "Filter (Image name contains)"-arrow.
    Note: PicTool supports images in tables or textframes but not eg. images in textframes in a table in selection range.




  8. SVG-Rotate

    Rotate a selected linked SVG-image 90°Left, 90°Right or 180°.
    If you use LibreO's builtin rotate command you will get an ugly rastered image. So this Tool will rotate the original linked SVG-File instead. It will make a backup copy named "filename(bak+number).svg" in a subfolder called "original".


  9. PDFview

    If you've placed the text cursor on a paragraph with a PDFfilename you can open that particular PDF in your default PDF-Viewer by clicking on the button "PDFview". If your cursor is somewhere else then you get a filepicker to choose a PDF you want to open.
  10. PDFadditions (needs PDFtk)

    You can add files to your PDF as PDF-attachments to the whole PDF or to specific pages. Or add a Background-PDF or PDF-stamp. By clicking this button you will first be asked to make a choice and then get a filepicker to add a file.
    Attachments:
    If you add a "page attachment" a non-printable green textframe with a number will be anchored to the page your cursor is placed. The chosen file will be copied into a folder with the same number inside the folder called "!.attachments" in your "source"-folder. You can add more files to the same number either by using the button or by directly copying to the folder. If you make a normal PDF-attachment (attached to the whole PDF), the files go into the folder "!.attachments" without creating a textframe.
    The use of attachments can globally turned off in the preferences ("Prefs"-button). You also can turn off/on any single "page attachment" by using the "PDFadd"-button: Have the textframe selected and click the button. The textframe will change color to red when turned off and green when turned on. You can have any content or text in the textframes as you like. Relevant for the feature is the name of the frame ("pdfattachment"+number) and the color.
    Background-PDF or PDF-stamp:
    You can add a Background-PDF by typing "b" or a PDF-stamp by typing "s" or manage both in the preferences ("Prefs"-button). The chosen PDF will be copied into a folder called "!.background" or "!.stamp" inside your "source"-folder.


  11. PDFedit (needs PDFtk)

    Every single PDF in your document can be be split and/or pages be rotated. This may be useful if you want to rearrange the order or delete some pages of an imported PDF.
    Rotating pages can be useful if the imported PDF uses a different page orientation than your LOSA-document.
    The PDFname and page number fields in the dialog will be filled depending what pages you have selected with the cursor. The "view"-button will launch the chosen PDF in your default PDF-Viewer.
    Hint: For easy selecting pages and page ranges use the "Web Layout"-view (1st Button).

    When you press ok the original PDF will be moved into a folder called "!.OriginalPDFs" and the splitted or rotated result-PDF(s) will be created in the "source"-folder and the correct entries to the corresponding "PDFfilename" paragraphs will be made.


  12. Prefs

    • Manage your "source"-folder:
    By default LOSA uses a subfolder called "source" for all used stuff: PDFs, folders of images, "!.illustrations","!.attachments","!.background" and "!.stamp"-folder. If you want to use a different location you can set it with the button "Choose Dir". The path of your chosen folder will be inserted into one of the textboxes. If you're on Windows the one called "Windows" will be used , if you're on Linux or OSX the one called "Unix" will be used. If there is no path set then the default directory will be used: That is a subfolder called "source" in the same place as your LibreOffice document.
    With the button "Show Content" you get a .txt-file (auto opened) with all the folders and files of the chosen directory. 
    • Turn on/off to update all indexes before export:
    You can have your indexes like TOC to be updated before export. If you have manually customized  your TOC you don't want to update it before export because this would remove your edits. 
    • Turn on/off the use of external programs: Inkscape, Poppler and PDFtk.
      If you want Inkscape to render fonts as paths when converting PDFs or eps-files to SVGs then tick "convert fonts to paths".

      With PDFtk installed:
    • turn on/off import PDF-Bookmarks: When importing PDFs you can have LOSA create "PDFsubheadings" from the Bookmarks of the PDFs.  
    • Manage PDF-Additions (PDF-Attachments, PDF-Backgrounds, PDF-Stamps)
      You can add and delete files.
      • PDF-Attachments: if you have page attachments (added with "PDFadd") then you can select the folder in the first box and see the content in the 2nd box. If you select no folder number then you see the content of the main attachments (=files that are attached to the whole PDF)
      • PDF-Backgrounds and PDF-Stamps: You can have multiple backgrounds and stamps and select which one is active here.
    • Manage PDF-Security


 (Hidden Buttons)

You can customize the Toolbar by right click and hide or unhide any button. There are indeed some hidden buttons (click on the little black arrow or right click on the Toolbar to see):
  1. Systeminfo 

    This button will show you what LOSA detects as your Operating System and if PDFtk, Inkscape and Poppler are enabled.

  2. cropSibSVGs

    You get a folder picker to select a folder. Run the Optimizer for Sibelius-SVGs on all contained SVG-Files. Processed Files will be named "filename_viewbox.svg".  The original SVGs will be moved to a subfolder called "original".
    (The Optimizer also runs automatically when pressing the "ill"-button for all SVGs in the "!.illustrations"-folder)
  3. svgfonts2paths (Needs Inkscape)

    You get a folder picker to select a folder. Batch convert the fonts of all contained SVG-Files to paths. Processed Files will be named "filename_paths.svg".  The original SVGs will be moved to a subfolder called "original".
  4. eps/pdf2svg

    (Needs Inkscape and for eps also Ghostscript(see chapter "Troubleshooting" or http://clownfishcafe.blogspot.de/2014/05/importing-eps-files-into-inkscape.html))
    You get a folder picker to select a folder. Batch convert all contained eps-files and 1-page-pdf-files to svg-files. The original eps- and pdf-files will be moved into a subfolder called "originalepspdf" (on conversion fonts can be converted to paths by activating fonts2paths in the preferences "Prefs"-button).
    (also runs automatically when importing images with the "ill"-button if Inkscape is activated in the Prefs)
  5. SVG-Rotate-Ex

    You get a folder picker to select a folder and a dialog to select 90°Left, 180° or 90°Right.
    All contained SVG-Files will be rotated and named "filename_rot!.svg". The original SVGs will be moved to a subfolder called "original".


  6. PDFtk-Ex (needs PDFtk)

    This button lets you choose an external PDF and add to it the stamp, background, PDF-Attachments (only main attachments, not page-attachments) and PDF-Security-Settings that are set in the Prefs ("Prefs"-Button). The result PDF will be located in the work-directory (the same folder as the LOSA-document)
  7. PDFedit-Ex (needs PDFtk)

    This button lets you choose an external PDF and split and rotate its pages. The result(s) will be in the "source"-subfolder (if not chosen another place in the Prefs ("Prefs"-button))
  8. PDFinfo (needs PDFtk)

    If you've placed the text cursor on a paragraph with a PDFfilename you can get some information about that particular PDF by clicking on the button "PDFinfo". If your cursor is somewhere else then you get a filepicker to choose a PDF you want to get information about.
  9. ChordTransposer

    ChordTransposer is a text tool. Transpose Chords and notes of a selected text passage to different key signatures and Capo places. You can use and translate between the following languages:
    English:    Bb  B  C  C# ...
    German:    B  H  C  C# ...
    German2:  B  H  C  Cis ...
    Italian:     Sib Si Do Do# ...

    Chords can be of any kind: Am7b5/C  (G7/B)  Dsus4  /D  /C  (/B)  A#knife
    Notes and chords must start with a capital letter! 

    Per Default only chords and notes with the Paragraph Style called "chords" will be processed. You can turn that off. But if your text looks like this:

    Am     C      D      G7
    lyrics lyrics lyrics lyrics
    Am     C      D      G7
    lyrics lyrics lyrics lyrics

    Am     C      D      G7
    lyrics lyrics lyrics lyrics
    Am     C      D      G7
    lyrics lyrics lyrics lyrics

    It is a good idea to use a "chords" and a "lyrics" Paragraph Style. The Button "format as "C&L" " can be used to format such kind of text with one click. Just select the whole passage with the mouse and click the button. Starting with the first selected paragraph every odd paragraph will get the "chords" Style, every even paragraph will get the "lyrics" Style. Empty lines will be skipped. 
    Format conversions:
    Button C&L->F: Convert the format of a selection from lyrics&chords to a format having chords in Textframes that are anchored to characters of the lyrics with paragraph style "lyrics(withChordFrames)."
    Button F->C&L: Convert the format from "lyrics(withChordFrames)." to "lyrics&chords"

    Button CPro>F: Convert the format from ChordPro to "lyrics(withChordFrames)."
    Button F->CPro: Convert the format from "lyrics(withChordFrames)." to ChordPro format.
    (Transposing of chords in ChordPro format is not supported)

    Button insertF: Add a ChordFrame at textcursor that is filled with the clipboard content and is ready to be filled in by typing over.

    Edit the paragraph styles "chords", "lyrics", "chords(inChordFrames)", "lyrics(withChordFrames) as you like.

    For transposing to the key signature F# first transpose to Gb, then press the "enharmonic switch".

    (Depending on the OS and distribution: If the Key and Capo lists are difficult to read because of a too large font you can zoom in/out with the little +/- buttons. (For a permanent change you must edit the Dialog of the macro)


  10. update-image

    With this button you can update a selected linked image. Works the same as going to "Edit"->"links" for updating images. Useful if you edited an image file in an external application.
  11. PDFmerger (needs PDFtk)

    A simple PDFmerger that lets you merge all PDF files of a selected folder. You can change the order and remove PDFs from the merging list.


PDF-attachments, stamp and background (needs PDFtk)

Your result PDF can have attachments, stamp and background (you can manage them in the preferences ("Prefs"-button).
  • Attachments to the whole PDF and/or to individual PDF-pages:You can add files to your PDF as PDF-attachments to the whole PDF or to specific pages. By clicking the button "PDFadd" on the TitleBar you will first be asked to make a choice and then get a filepicker to add a file. If you add a "page attachment" a non-printable green textframe with a number will be anchored to the page your cursor is placed. The chosen file will be copied into a folder with the same number inside the folder called "!.attachments" in your "source"-folder. You can add more files to the same number either by using this button, by going into preferences (button "Prefs") or by directly copying to the folder. If you make a normal PDF-attachment (attached to the whole PDF), the files go into the folder "!.attachments" without creating a textframe.
    Attachments can globally turned on/off, added and deleted in the preferences ("Prefs"-button). You also can turn off/on any single "page attachment" by using the "PDFadd"-button: Have the textframe selected and click the button. The textframe will change color to red when turned off and green when turned on. You can have any content or text in the textframes as you like. Relevant for the feature is the name of the frame ("pdfattachment"+number) and the color.


  • A stamp and/or a background on all pages:
    With the button "PDFadd" on the ToolBar you can add a Background-PDF (type "b") or a PDF-stamp (type "s"). The chosen PDF will be copied into a folder called "!.background" or "!.stamp" inside your "source"-folder.
    Stamps and backgrounds are added to the PDF using PDFtks multistamp and multibackground feature: applies each page of the stamp/background PDF to the corresponding page of the input PDF. If the input PDF has more pages than the stamp/background PDF, then the final stamp/background page is repeated across these remaining pages in the input PDF. That means you can use 1-page-stamp/background-PDFs or even multipage stamp/background-PDFs.
      Backgrounds and stamps can globally turned on/off, added and deleted in the preferences ("Prefs"-button).


About the paragraph styles "HiddenHeading", "HiddenHeading1-7" and "PDFfilename"

  • These paragraph styles are used as placeholder for the PDFs. On exporting your final PDF by pressing the Button "Out" the text on these paragraphs will be hidden by setting the text colour to white and the font size to very small. After the export has finished this will be reset.
  • HiddenHeading is always on the first line of the first page of an imported PDF. Then and on all other pages there can be "HiddenHeading1" - "HiddenHeading7" and then there must be "PDFfilename". This is filled with the actual filename on the first page and is empty on all the remaining pages.

HiddenHeading

  • This paragraph style has a page break "before" so the heading will always be on a new page. If you want it to start always on right/odd pages you can edit the paragraph style to use a page style like "Right Page" along with the page break.
  • The text in this paragraph will be used in the Table-of-Contents (TOC). It is set on Level 3 as default. If you want to assign "HiddenHeading" to another level edit the "Outline Numbering" under "Format" ► "Styles and Formatting (F11)" rightclick "HiddenHeading" "Modify" "Outline Numbering" or rightclick on a HiddenHeadingin your document and choose "Edit Paragraph Style" "Outline Numbering".

  • To change the order of your imported PDFs best use LibreOffice's Navigator. There select the heading and shift it up or down by using the up/down arrow buttons. (If you turn on "Contents View" then you can drag'n drop.)
    Change the TOC-Level by using the left/right arrow buttons.

HiddenHeading1  -  HiddenHeading7

  • These paragraph styles are useful if you want to insert TOC-entries and PDF-Bookmarks to individual pages of a PDF or image score. It should always be inserted above any "PDFfilename" or "PICFolderFilename". (Easiest way to do that is to put the cursor to the end of a preceding paragraph and hit "Enter".
  • The default TOC-Levels are Levels 4-10

PDFfilename/PICFolderFilename

This paragraph styles have a page break "after" so the first "PDFfilename" paragraph (holding the filename of your imported PDF) sits directly below a "HiddenHeading" on the same page, and any further empty "PDFfilename" paragraph (that reflects a further page of the PDF) starts on a new page.

About using page styles and page numbers

The LOSA sample document contains 2 custom page styles with centered page numbers in the header: PagenumberTopCenter and PagenumberTopCenterLandscape. Of course you can use and edit any page style as you like. You might have to insert a "manual page break with page style" if you want to change from one style to another within your document. So for example: If you delete all paragraphs after the TOC all further pages would use the page style of the TOC, that is "Default Style" without page numbers. If you want your imported PDFs to use another page style you have to insert a "manual page break with page style". Go to "Insert"►"Manual Break" and choose your page style. There you can also set a page number change.

About the exported PDF (by clicking button "Out")

  • The exported PDF will be placed in the same folder as your LOSA document and you will be asked for a name.
  • The infokeys in the PDF like "Title" and "Author" that you can see in your PDF Reader can be set in LibreOffice:
    1. Author
      Go to "Tools""Options"►"LibreOffice"►"User Data" edit, check "Use data for document properties" and click on reset.
      Also go to "File"►"Properties"►"General", check "apply user data" and click on reset.
    2. Title
      Go to "File"►"Properties"►"
      Description"►"Title"
  • The PDF options that you see when you go to "File"►"Export as PDF" will also be used when clicking the "Out"-button. Make your settings there, click on "Export" and then just click "Cancel". From now on these settings will be used. This can be handy if you want to include commentaries in your PDF.

More Possibilities

  • You can use the LOSA as well without TOC or Title Page to merge PDFs. Just delete the unneeded parts. The exported PDF will have PDF-Bookmarks.
  • You can also manually add PDF-Bookmarks (and TOC entries) to any page by using the paragraph styles HiddenHeading and HiddenHeading1-7.
    By putting the cursor at the end of a "HiddenHeading", "PDFfilename" or "PICFolderFilename", pressing "enter" the next paragraph style will be "HiddenHeading1".
  • Or just attach multiple PDFs without giving each one a "HiddenHeading".
  • If you want Headings to appear in front of an imported PDF or image score you can of course use any standard or custom Heading style.

Troubleshooting

Error when clicking the "Out"-Button.

Turn off LibreOffice' "View PDF after export". Go to: File->Export as PDF->General->untick "View PDF after export". Then "Export", then "Cancel". Now the setting is stored. LOSA will ask you by itself if you want to view the PDF after export.

The text and noteheads in the SVGs are not shown at all (on Linux)

You need the fonts to be installed. If you are using Sibelius then copy the fonts from Windows font folder to your Linux font directory. On my system that is:
home/yourname/.fonts

Some text and noteheads in the SVGs that were generated by Inkscape are not shown correctly

Don't use LibreOffice 5. The rendering of some characters of the Opus Standard font is broken in LibreOffice 5. Use 4.4.7. Sometimes saving and reopening the file also helps.

The text and noteheads in the SVGs are not shown in the exported PDF (on Windows)

Close Sibelius. LibreOffice does embed the fonts used in the SVGs into the final PDF but can't do this if Sibelius is open and occupies the fonts.

How can I put the cursor in the text if an image is in front of the text?

Click outside the image to the left or right of the text line.

How can I set up Linux to use Inkscape as editor for the svg files (using the "ill" button)?

 If nothing else helps then try this:
create a svg file like a.svg

then in the terminal:

find out the mime type of the file:
xdg-mime query filetype a.svg

I get: image/svg+xml

(find out the default  application for that filetype:
xdg-mime query default image/svg+xml

I get: gpicview.desktop)

set inkscape as default application:
xdg-mime default inkscape.desktop image/svg+xml

How can I change the order of the headings?

To change the order of your imported PDFs or scores in image format best use LibreOffice's Navigator. There select the heading and shift it up or down by using the up/down arrow buttons.  (If you turn on "Contents View" then you can drag'n drop.)
Change the TOC-Level by using the left/right arrow buttons.

Macro Security

To be able to use the embedded macro you have to change the macro security settings: Go to "Tools"►"Options"►"LibreOffice"►"Security"►"Macro Security". Restart LibreOffice.

Do I need JavaRuntimes?

No.

Inkscape/Poppler not found (on Windows)

You have to add the paths to binaries of these programs to the Windows Environment Variables.
On Windows 7 rightclick "Computer"►"Properties"►"Extended SystemSettings"►" Environment Variables" ► "System Variables"►scroll down to variable path, select, press "edit" and add something like: ;E:\Programme\inkscape\;E:\Programme\poppler-0.26.4\bin\



Error when pressing Button "In" or "PDFinfo"

On Windows these features don't work if there are special Characters somewhere in the path to where you placed the LOSA.odt document. Please use another place. (Or turn off PDFtk in the preferences (Prefs"-button))    (this is only if your computer-username contains spaces or special characters)

Eps2svg conversion doesn't work?

You must have Ghostscript installed. On Windows you must add Ghostscipt to the Environment Variables if you installed it after Inkscape so Inkscape finds Ghostscript. (See http://clownfishcafe.blogspot.de/2014/05/importing-eps-files-into-inkscape.html)
After you have installed Ghrostscipt add the paths to \bin and \lib in the Windows Environment Variables.
On Windows 7 rightclick "Computer"►"Properties"►"Extended SystemSettings"►" Environment Variables" ► "System Variables"►scroll down to variable path, select, press "edit" and add something like: ;C:\Program Files\gs\gs9.14\bin;C:\Program Files\gs\gs9.14\lib

Make sure, there are no special characters in the path to your "source" folder or eps-file.

What about this folder called "temp"?

You can safely delete it.

Where is the "Buy"-Button?

Had no money to implement it.
This is a gift for you! I'm very grateful for all the people that made their software, code and knowledge available free for others to learn and benefit. That is the ground on which this project started to grow. You can help me by reporting problems or bugs that you may encounter. Or if you have any questions or wishes feel free to contact me: struckkai@gmx.net