Saturday 25 April 2015

LibreOfficeSongbookArchitect



LibreOfficeSongbookArchitect
(LOSA)



 https://youtu.be/bL5kNqowtgE
(For some explanations turn on Subtitles)



Download this page as PDF:
LOSongbookArchitect-Documentation.pdf

Intro

LibreOfficeSongbookArchitect(LOSA) is a LibreOffice/OpenOffice Document with special Macros on a 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. 

The reason I started this project was the wish to create a songbook out of my music scores which are in PDF or SVG format. Most Notation Programs are good in creating Music Scores but quite bad in putting all together into a Book with eg. a TOC.

After reviewing LaTex, Adobe InDesign, Magix/Xara Photo&Graphic Designer, Serif Page Plus, Affinity Publisher, Scribus and other DTP programs I created my own solution with features you won't find there.
LOSA only uses free software available on all major platforms. It can make usage of PDFtk, Inkscape, Ghostscript and Poppler to go beyond the limits of LibreOffice.
Perhaps the main feature is the ability to merge external PDFs into the PDF-output of LibreOffice.
It allows to lay external PDFs over pages of your odt.-document. This usage of external PDFs leads to some advantages: your odt-document keeps small and responsive and updating PDFs is easy.

LOSA is designed for huge projects with lots of external files. The Work-flow for the main part is essentially 2 Buttons: "In" and "Out".
All other Buttons on the Toolbar are for Tools that may be helpful for the document, or are Tools for processing external PDF-files.

Last update:
17.4.2023

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 Hyperlinks) and automatically create "invisible" headings from filenames (or PDF-Titles) 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)
  • Create Sections for each imported PDF or Image-Score: Allows easy hiding any PDF etc.
  • PDFdummies: Show non-printing preview images of imported PDFs. (needs Ghostscript) 
  • PDFshiftscale: Shift and scale all "imported" PDFs (see "Prefs") or change page size, shift contents and do "2up" or "2down" of a selected PDF. (needs PDFtk and Ghostscript)  
  • 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 .ps-, EPS-Files to SVG (Needs Inkscape)
  • eps/pdf2svg-converter: Convert folder of .ps-, 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, deleting 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: Transpose ChordDiagrams, text Chords and notes of a selected text passage to different key signatures and Capo places. Also standalone ChordTransposer extension available:
  • ChordDiagrams: Create and edit ChordDiagrams for Fretted Instruments. Also standalone ChordDiagrams extension available:
    OpenOffice 4: https://extensions.openoffice.org/de/node/18755
    LibreOffice 4: https://extensions.libreoffice.org/extensions/chorddiagrams
  • PDFmerger(needs PDFtk)
  • PDF2images: Convert folder of PDFs to images (needs Ghostscript)
  • PDFrgb2cmyk: Convert folder of PDFs from RGB to CMYK (needs Ghostscript)
  • PDFfonts2paths: Convert folder of PDFs. Render Fonts as Paths (needs Ghostscript)
  • IndexTools: Parse Data from Filenames and automatically create custom clickable Indices: Custom sorted Data Table, Alphabetic Title Table and Alphabetic Composer Tables  

What you need

  1. LibreOffice (https://www.libreoffice.org/) (~200 MB) or OpenOffice.
    A good old version is LibreOffice Version 4.4.7.2 which you can find here:
    http://downloadarchive.documentfoundation.org/libreoffice/old/
  2. The LOSongbookArchitect.odt-document (~160 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.

    For OSX ElCapitan/Sierra get it here: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
  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"
    For OSX get it here: http://macappstore.org/poppler/
On Windows PDFtk,Inkscape, Poppler and Ghostscript can be used as portable Apps (in the LOSA-Folder) or installed regularly. As regular Installations in the default Windows Program Folder they should be automatically detected. The paths to Inkscape, Poppler and Ghostscript can also manually be added to the Windows Environment Variables. (see Troubleshooting)
(Inkscape needs the fonts installed of the PDF that you want to convert. Poppler can use the embedded fonts of the PDF.)
(Inkscape Version 1.xx+ now also has an internal Poppler conversion option)
All the programs are available for Windows, Linux and Mac OSX. LOSA is tested on Windows7/10 and Linux (Lubuntu, Linux Mint) and a VirtualBox install of OSX Sierra. 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:
Enable the execution of macros. Go to "Tools"►"Options"►"LibreOffice"►"Security"►"Macro Security". Set it to "Medium" or "Low". Restart LibreOffice.
RULE#3: 
When working with PDFtk then also make sure to tick "Export automatically inserted blank pages" at the PDF-Export-Options.
Go to: File->Export as PDF->General->tick "Export automatically inserted blank pages". Then "Export", then "Cancel". Now the setting is stored.

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). Please customize the Toolbar as you like. 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.pdf1
    2
    3
    HiddenHeading
    PDFfilename
    PDFfilename
    PDFfilename
    This entry will go into the Table-of-Contents and the PDF-Bookmarks.
    The first "page"-paragraph holds the filename and a pagenumber.
    Every further "page"-paragraph holds a pagenumber.


    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 .ps-, EPS-Files will automatically converted to SVG-Files. The original PDF and .ps-, 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 (you can change that in the "Prefs").
  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.
    XShift and YShift can be used to shift images by the same amount relative to their "From Left"
    and "From Top"-Position.

    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.  (LO Versions 6+
    seems to have this fixed) 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 or deleted. 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.

    Note: There are 2 ways to do these things: You can directly edit and delete the PDFpagenumbers in the document and rotate a page by adding one of these commands directly after the pagenumber: north, south, east, west, left, right, down.
    e.g.:
    Bach.pdf1
    2left
    3right
    You can add normal Text pages between the PDF-pages and change the order as you like. This is the preferred non-destructive way because it doesn't touch the source PDF but will only use the specified pages in the specified way.

    The other way is by using this Tool. This will make a copy of the Source-PDF and make the changes on this copy. So it is destructive.
    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.  
    • Ask name: You will be asked to enter a custom name for the exported PDF.
    • Auto-open: Open the exported PDF automatically with default Viewer without asking.
    • Ghostscript PDFdummies: Set Resolution and smoothing of images created by "PDFdummies"-Button and "PDF2images"-Button.
    • Turn on/off the use of external programs: Inkscape, Poppler and PDFtk.
      If you use Inkscape Version higher than Version "0.xx" you must tick the checkbox ">=Version1"!!!
      If you want Inkscape to render fonts as paths when converting PDFs or eps-files to SVGs then tick "convert fonts to paths"
      .
      Now Inkscape Version 1.xx also supports the conversion using internal Poppler.

      With PDFtk installed:
    • import PDF-Bookmarks: When importing PDFs you can have LOSA create "PDFsubheadings" from the Bookmarks of the PDFs.  
    • import Hyperlinks: When importing PDFs you can have LOSA also import their internet Hyperlinks. For this LOSA will create transparent TextFrames holding these Hyperlinks (FrameStyle: HyperlinkFrame). (For correct placement the Pagedimensions of LOSA and the PDF must be the same.)
    • import empty links: internal PDF links usually will be broken on Import. This checkbox will create transparent TextFrames at the places, so you can reassign Hyperlinks to them.
    • use PDFTitle: This will create Headings from the PDF-Title instead of the Filenames if existing.
    • PDFs in Front: If turned on, PDFs will be put in the foreground instead in the background when exporting.
    • PDFshift & Scale: If Ghostscript is installed, you can globally scale the contents and shift the horizontal and vertical position of all "imported" PDF-pages when exporting. X-shift can be mirrored on even pages. It is recommended that your PDFs have the same Pagesize as your odt-document.
    • 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 .ps-, 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 .ps-, eps-files and 1-page-pdf-files to svg-files. The original .ps-, 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 add the stamp, background, PDF-Attachments (only main attachments, not page-attachments) and PDF-Security-Settings that are set in the Prefs ("Prefs"-Button) to a chosen file. Either to the PDF under the text cursor (PDFfilename) or you get a Filepicker. A backup-copy of the Original PDF will be created in a subfolder called "!.originalpdf".
  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 can transpose the standard Chorddiagrams that were created with the Button "ChordDiagramsInput" (The default ChordDiagram types beside major are: 5,7,m,m7,m7b5,maj7,sus4,7sus4,dim7).

    It is also 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# ...
    Scandinavian: Bb  H  C  C#

    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! 

    If you want to use the music symbols ♯ and ♭ instead of # and b you can tick the checkbox "♯,♭".

    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.

    ChordPro-Formatter:
    These buttons help you to format original ChordPro files with directives like {title:},{composer:} etc.
    The Button "format" will convert all line breaks of a selection into true paragraph breaks and create paragraph styles for each found directive:
    Title, subtitle, artist, composer, lyricist, copyright, album, year, key, time, tempo, duration, capo.
    The Button "cleanlyrics" will delete all [chords] from a selection.

    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. ChordDiagramInput

    This is a set of 4 Buttons that lets you create and edit ChordDiagrams for Fretted Instruments. Chord Diagrams are inserted as grouped Draw Elements and thus can also further be edited afterwards.
    Supports any number of strings and frets.
    This Button lets you insert new or replace selected chords by typing in. (LibreOffice: If you have a text passage selected all words will become ChordDiagrams. OpenOffice will crash).
    Type the name of the chord e.g.: c or cm
    Default types besides major are: 5,7,m,m7,m7b5,maj7,sus4,7sus4,dim7
    These default types can be transposed with "ChordTransposer" Further types are: -scale and -scalefull. To create horizontal Diagrams type "-" so e.g. -c-scalefull will create the horizontal Diagram shown in the screenshot (scroll down)

    Alternatively you can also type in a Chord-Code e.g. C:x/3/2/0/1/0 This will create a normal C Chord. Strings are separated by / . So 6strings need 5/
    The MainSyntax is: Name:Dots:Barrees:FretLabels
    3 kinds of Dots are possible: Default is circle. For a square add s behind the number, for a diamond add d behind the number e.g.: C:x/3d/2s/0/1/0

    To add text to the Dots, Barrees or FretLabels type: ,text so:
    C:x/3,3/2,2/0/1,1/0 adds text into the Dots.
    Barrees are added with :B and Fretnumber e.g.: F:/3/3/2//:B1 is a standard F-chord
    Partial Barrees can be input by giving Start and End values
    Example: Dm7:x/x/0/2//:B(2-1)
    You can add FretLabels to any Fret with :Lfretnumber,text e.g. :L1,yourtext
    When you add a FretLabel to the first Fret then the Nut will be removed. So the F-Chord can be changed into a G-Chord at the 3rd Fret only by adding a FretLabel to the first Fret:
    G:/3/3/2//:B1:L1,III
    More Dots on the same string (for scales) can be entered by using - so this will create a Grid with 1 string and 3 dots:
    ScaleExample:1-3-5
    Just look at Code generated by the Chord-Editor
  11. ChordDiagramEdit

    This Button lets you insert or replace selected chords by Editing in a Chord-Editor. The Editor supports 1 to 6 strings and 1 to 12 Frets.
    Left mouse button will add Dots.
    Shift+Click will remove Dots.
    Ctrl+Click will change the Dot Style: Black = circle, grey = square, blue = Diamond.
    The result Diagram will only include filled Frets or Labels. So if you want to show 12 Frets but only have Dots until the 10th Fret then add some text to the 12th FretLabel eg an empty space. Here you can also have a look at the autogenerated Chord-Code. The Chord-Code is what will create the Diagram. You can turn Auto-Mode off and add more strings if you like.
  12. ChordDiagramStyle

    This Button lets you set the Preferences for new ChordDiagrams and change the style of selected chorddiagrams. (The Setting will be saved into the Custom Document Properties of your Document) For Reset just Delete this Property in File->Document->Properties->Custom Properties)
    You can import styles from selected chords and apply to selections. There is also a realtime mode available.
    If you want to use the music symbols ♯ and ♭ instead of # and b you can tick the checkbox "use
    ♯,♭ in Texts".
    The Button at the Top called "Rebuild selection" is for the cases when you want to apply a different structure to already existing Chords like the minimum number of shown Frets or the Layout Orientation.
  13. ChordDiagramExport

    This lets you export selected Chords to SVG or .png format. (Or you can copy and paste a chord into Draw and export from there)
    Some Hints:
    - To change the scale of the diagrams best use the "Style"-Button. (You can also directly change the Size by dragging the corners manually and then fix the Text Sizes by importing, editing and applying the Style.)
    - Anchoring "AS Character" is possible but not recommended. ( "AS Character" doesn't allow manual editing of the elements as described below:)
    - Every part of a Diagram can also be edited directly by either entering the group or ctrl-click. To edit text double-click on it. To change color use the Navigator. To move parts use the keyboard arrow-keys, for small movements use alt+arrow-keys. On Windows multiple parts can be selected with shift+ctrl-click
    -if you want to select or change multiple chord diagrams at once you can select them by double clicking on a Chordname in the Navigator, or by selecting one chord diagram in the document and shift clicking on more. Or select one chord diagram and then shift+click and drag to make a selection rectangle. You can also just make a normal text range selection. Then all chord diagrams that are anchored within this selection range will be affected by applying a style.



  14. 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.
  15. 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.


  16. PDFdummies (needs Ghostscript)

    If you want to see (non-printing, low-res) Preview images of the pages of a PDF in your document you can place the cursor on the PDFfilename and press the hidden Button "PDFdummies". Image resolution can be changed in the "Prefs".
  17. PDF2images (needs Ghostscript)

    Convert folder of PDFs to images. Image resolution can be changed in the "Prefs".
  18. PDFrgb2cmyk (needs Ghostscript)

    Convert folder of PDFs from RGB to CMYK
  19. PDFfonts2paths (needs Ghostscript)

    Convert folder of PDFs. Render Fonts as Paths
  20. PDFshiftscale (needs PDFtk and Ghostscript) 

    Very powerful tool to change page size, shift contents and do "2up" or "2down" of a selected PDF. If you have the cursor placed on a PDF-file in the document (PDFfilename) this will be processed. Otherwise you get a filepicker to select an external PDF.
    You have 3 modes:
    Shiftscale: Change size of PDF page and its content.
    2up: Layout 2 pages on 1 page side by side (or top and bottom). Automatic settings should be ok. Rotate afterwards.
    2down: Cut double pages into single pages. (Use Rotation if the source is rotated left or right to get correct orientation in the end.)

    When you click "Preview/Ok" your PDF will be processed and you will be asked if you want to save it. A Backup-Copy of the original PDF will be saved in a folder called "!.OriginalPDF".
    (Hint: If changing pagesize of a PDF doesn't work as expected it may be because of a defined CropBox in the PDF. You could hack this with a Text-Editor: Open the PDF in the Text-Editor and replace all "/CropBox" with eg. "/cROPbOX".)

  21. insertHyperlinkFrame

    This will create a transparent Textframe (Framestyle: HyperlinkFrame) that can hold a Hyperlink.

  22. insertHideFrame

    This will create a white Textframe (Framestyle: HideFrame) that can be used to hide unwanted stuff like unneeded pagenumbers of an imported PDF. (use button "PDFdummies" to see the PDF pages in your document)
    In your document the HideFrame will show semi-transparent for better working but will be opaque in the exported PDF.


  23. create_HH_sections

    This will (re-)build named sections for every chapter based on HiddenHeading. Note: After the macro has finished (a matter of seconds) LibreOffice may need some time to recalculate correct page numbers in long documents.

  24. Save_Sections_HideState

    This will save a list of all hidden Sections into the "Custom Properties" of your document. It may be useful if you create different versions of your document with some Sections Hidden and want to save this state.
  25. Load_Sections_HideState

    This will hide all Sections in your document based on the list that was created with the Button "Save_Sections_HideState". (To unhide Sections you can use the normal edit dialog in the Navigator)

  26. IndexTools

    In addition to the normal TOC you can create custom clickable Indices from custom data like Composer, Title, Genre, CD-Track etc. For that you can use your own Paragraph-Styles to hold the Data.
    If you want these data-Paragraphs hidden on the final Export then give the Paragraph-Styles names like "HiddenGenre".
    I suggest you at least use a Style for Composer and Title. They should have "Composer" or "Komponist" and "Title" or "Titel" in its name.
    IndexTools can automatically create Data-Paragraphs and Paragraph-Styles from a chosen Paragraph-Style
    by clicking the Button "Parse and format".
    For example you imported a PDF called "Bach - Bourree - CD-Track 1.pdf" then you have a HiddenHeading called "Bach - Bourree - CD-Track 1".
    Now you can set the Parse-Structure to:
    "HiddenComposer - HiddenTitle - HiddenCD-Track" and the Separator to " - ". (Make sure the Separator is the same as in your given Structure. So if you had eg. "Bach--Bourree--CD-Track 1" then the structure should be "HiddenComposer--HiddenTitle--HiddenCD-Track" and the Separator "--")
    By clicking the Button "
    Parse and format" LOSA will create separate Paragraphs with the corresponding Paragraph-Style that hold the data.





    Then you are prepared to create 3 different kinds of Index-Tables:
    1. Overview-Table
    Set your own Columns, Order and Sorting in the "Overview-Table Columns"-Textfield separated by a comma ","
    . Use the same Names like in the above Textfield.
    If you have created an Overview-Table then you can press the button "(Calc)" to open a special
    version of it in Calc (with added Hyperlinks to the PDF-files).
    2. Alphabetic Table
    This is a
    n alphabetic list of all Titles. Optional with Initials as Headings, and with other
    data eg. Composer added in brackets.
    If you use Initials you can allow the tables to split at pagebreaks. (If you don't use Initials the table will always split)
    3. Composer-Tables
    An alphabetic list of Composers and their Titles.
    You can allow the tables to split at pagebreaks.
    4. Hierarchic Table
    An alphabetic list of a chosen Category (1st Listbox) eg. "Genre" or "CD-Tracks" and the Titles optional with other data (2nd Listbox) eg. Composers added in brackets. You can allow the tables to split at pagebreaks.
     
    When you press "Create/update Index-Tables" they will be created at the cursor. When they exist then pressing the Button will update the tables at their place. You can edit the created Table-Headings as you like.
    The checkbox "Composer: Lastname, Firstnames" can be ticked to swap all Composer
    Firstnames behind the Lastnames: e.g. "Johann Sebastian Bach" will become "Bach, Johann
    Sebastian".
    If there is already a comma "," in the name it will stay the same.

    IndexTools has a second page with "Paragraph-Style Tools" that you can invoke by clicking on the yellow Button called
    "Paragraph-Style Tools".
    You see 2 lists of Paragraph-Styles and can perform the following actions:
    1.delete paragraphs in Doc
    All paragraphs
    in your Doc of the selected Styles in the left list (multiselection possible) will be deleted
    2.Replace with this Style
    All paragraphs in your Doc of the selected Styles in the left list (multiselection possible) will be assigned the selected Style of the right list.
    3.Append all (left) after (right)
    Below all
    paragraphs in your Doc of the selected Style in the right list new paragraphs will be created with the selected Styles in the left list (multiselection possible).
    Eg: You have "HiddenComposer" and want to create "HiddenSongwriter" directly below it for ALL instances.











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 and a pagenumber on the first page and is filled only with pagenumbers 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 and a pagenumber) sits directly below a "HiddenHeading" on the same page, and any further "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

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

Use LibreOffice 5.2.3.3 and higher. The rendering of some characters of the Opus Standard font is broken in earlier LibreOffice 5. Or use LO4.4.7. Or if the Basic Macro Editor Window is open, close it.
Or convert again using the internal Inkscape Poppler Option.

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.

PDFtk/Inkscape/Poppler/Ghostscript not found (on Windows)

On Windows LOSA can make usage of the Programs in 2 ways:
1.Portable: In the same Folder the LOSA.odt is placed create a "Apps"-Folder. Into this folder create Folders for each program with the following names and copy the whole program stuff into each:
Apps\
         PDFtk
         Inkscape
         Poppler
         gs

(The Folders of PDFtk,Poppler,Ghostscript and Inkscape_Version_1_and_higher should each contain a "bin"-Folder. If you use Inkscape Version "0.xx" then it doesn't contain a "bin"-Folder. Be sure to check the LOSA-"Prefs" and set the correct Version there!!!

 The Poppler-Folder should have no version-numbers here.)
2.Regular Installation: If installed in the default Windows Program Folder they should be automatically detected. The Poppler-Folder should have the full version number here eg. "poppler-0.52.4". 
If installed elsewhere the paths to Inkscape, Poppler and Ghostscript can also manually be added 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:
;C:\Program Files\Inkscape\bin\;E:\Programme\poppler-0.26.4\bin\;C:\Program Files\gs\gs9.15\bin;C:\Program Files\gs\gs9.15\lib



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
.ps-, 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.
A lot of work, time and knowledge went into this project and if you think it is worth a Donation I'd really appreciate it.

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

45 comments:

  1. Hello, I installed your plugin for Libre Office - PicTool, and I'm pretty happy. Are you still working on it? Because I think it will be nice to see some notification (showmessage) when plugin finished updating pictures. Or cursor as hourglass. When I'm updating more than 200 pics it takes some time and I don't know when it is finished.

    ReplyDelete
    Replies
    1. Thanks for reporting that good idea! Updated to version 1.0.6 with a simple progress bar (standard place at the borrom of writer window). If the green bar disappears PicTool has finished its job. Don't know if and how long LO may take its time to update layout. 200 pics is a lot and I experienced a huge performance increase by setting LO to not show graphics. In the process of creating the PicTool I became aware that using Framestyles is a very good idea! But sometimes PicTool might be a real time saver and layout rescuer.

      Delete
  2. Thanks for your nice PicTool Extension, Kai!
    I'd like to report a small bug in your version 1.0.6.
    Installed on LibreOffice 5.1.6.2. When running PicTool I get an error in the Macro script:
    Inadmissible value or data type.
    Division by zero.
    Lines 1047 & 1048 should be rem-med!

    ReplyDelete
    Replies
    1. Hi Joseph,
      Thank you for giving the error details.
      this means Libreoffice can't get the Size of an image and thinks it is 0. Sometimes LO is too slow or you indeed you have an image with size of 0.
      Rem-ing the lines deactivates Size-processing.
      But you can insert these lines right above 1047 and then it will tell you which image is the "bad" one :-)

      rem---Error handling start------------------------------------------
      do until g.ActualSize.Width > 0 and g.ActualSize.Height > 0
      wait 10
      timercount = timercount + 10
      if timercount > 500 then
      sVar3 = MsgBox("Error: Problem getting Size of: " & chr(10) & chr(10) & g.Name & chr(10) & chr(10) & "Try again?" ,1)

      If sVar3 = 2 then
      oProgressBar.end
      Exit sub
      End if
      timercount = 0
      end if
      loop
      rem---Error handling end----------------------------------------------------

      Delete
    2. Updated PicTool to version 1.0.7
      On the LibreOffice Extension website scroll down to find it.

      Delete
  3. Thanks for the update, Kai. Will test it later on.

    ReplyDelete
  4. I try to work in MAc OSX(Sierra) but I can't start to use the LOSAI :(
    Did you alredy test with Mac OSX?
    Thanks

    ReplyDelete
    Replies
    1. Hi,
      sorry no, as I don't have a Mac to test.
      But you can contact me per email (struckkai@gmx.net) and tell what doesn't work. I suppose you have problems with external programs like pdftk or poppler?

      Delete
    2. Thank you, I'll write you.

      Delete
  5. Hello
    I just discover PicTool, very useful extension. But it don't has the only think that I was looking for: "Compress". Is it possible one day that you complete PicTool with the compression settings? (Right click on a image > compress).
    Have a nice day
    Sirio

    ReplyDelete
  6. Sorry, no, the pictool won't change anything of the actual files.

    But you can try the OpenOffice extension PixCompress:
    http://extensions.openoffice.org/de/project/pixcompress
    (I haven't tested it and probably you'll have to reassign macro buttons if you want to use it in newer version of LO)
    Or work with linked images instead of embedded. Then you could batch compress and convert all images with any external tool like Irfanview.
    For changing embedding images to linked I wrote this little tool:
    https://extensions.libreoffice.org/extensions/extract-embedded-images-and-replace-embedded-images-with-linked-images-picextract

    ReplyDelete
  7. new LOSA version (direct control over PDF-pages (see Tool PDFedit)) is again working also for OSX and Linux.

    ReplyDelete
  8. Hey great work.
    Your extension ChordDiagrams https://extensions.libreoffice.org/extensions/chorddiagrams are only available if the user is logged in. I think you need to publish it before its available for anonymous users.

    Cheers,
    Leif Lodahl

    ReplyDelete
    Replies
    1. Hello Leif,
      indeed there are some problems at the extension website. I marked it for publishing but somehow it is on a strange status. Even when I log in I can't see the actual status or make any changes because the Edit-Sidebar there is empty. I wrote to the LibreOffice mailinglists but received no answere yet.

      Delete
    2. The libreoffice extension is now published

      Delete
    3. Hello Leif,
      thank you for the article on libreofficedk.blogspot
      Now I found out why some of the functions don't work on some Linux Systems like Ubuntu and Linux Mint. (Lubuntu works)
      There is a bug with a simple basic command on these systems, so I filed a bug report:
      https://bugs.documentfoundation.org/show_bug.cgi?id=113615

      Delete
    4. Hoorray! The Bug that breaks the advanced functions on Linux Mint and Ubuntu is fixed in LO 5.4.4 !

      Delete
  9. Hello, I can't find the ChordDiagrams toolbar, it is not appearing in Libreoffice 5.4.2.2 writer or draw after adding the extension. Where do I find it? Thanks, Sam

    ReplyDelete
  10. For Toolbars to appear you have to restart LibreOffice. Perhaps they should add this into the official extension installing guide. Does it appear now (writer only)?

    ReplyDelete
    Replies
    1. Hi Kai, Even with restarting Libreoffice Writer, ChordDiagrams doesn't appear in View > Toolbars, or anywhere else that I've looked. Perhaps, it is because I am using Libreoffice Writer version 5 and not 4? My OS is Linuxmint 18.2 64bit.

      Delete
    2. Hi Sam,
      that is strange, it works for me here on a LO5, LinuxMint, 64bit.
      The next guess is: The Toolbar certainly wouldn't appear if you were installing the OpenOffice-Version in LibreOffice.

      Delete
    3. Just tested it again, it should appear. If it doesn't you can also manually create the Toolbar and assign the correct macros. BUT there is something broken with all LibreOffice5 versions I tested on Linux Mint, which also breaks some cool functions (import and apply styles, edit existent chords with Edit-Button, export images). Haven't tested with LO4 on Linux Mint. All these work on all version in Lubuntu, OSX, and Windows).
      You can also contact me per email address. (last word in the article)

      Delete
    4. I did accidentally installed the OpenOffice version. Now that I have installed the correct version for LibreOffice, the ChordDiagrams toolbar is now available. Thanks for the help!

      Delete
    5. So it seems that all LibreOffice versions (4 and 5) I tested on Linux Mint have a broken basic command, which also breaks a lot of functions of this extension. OpenOffice4.1.4 works correctly on Linux Mint. Other Linux distributions like Lubuntu don't suffer this problem.

      Delete
    6. Hoorray! The Bug that breaks the advanced functions on Linux Mint and Ubuntu is fixed in LO 5.4.4 !

      Delete
  11. Thanks for all the testing. Even with the Snap version of LibreOffice in Linuxmint, some of the functions of the extension aren't working. I'll try OpenOffice. Perhaps, the bug should be reported on the Linuxmint site? Thanks again, Sam

    ReplyDelete
    Replies
    1. Not too happy to report that also OpenOffice4.1.4 shows the bug after saving and reloading the odt. At the moment the only Linux Distribution it works correctly is Lubuntu.
      For LibreOffice I filed a bug report:
      https://bugs.documentfoundation.org/show_bug.cgi?id=113615

      Delete
  12. Thank you for your great plug-ins. Glad to see that you are still working on them.
    I found some issues with ChordPro conversion of ChordTransposer (Win10). Where shall I post detailed descriptions with sample files and screenshots? Thanks in advance.

    ReplyDelete
    Replies
    1. Hi,
      feel free to contact me via email (struckkai@gmx.net).

      Delete
  13. Hello,
    I was trying to increase the header height directly in the odt file but it has not impact on the final rendering.
    Do you know why or which is another way to increase the distance from the page number?
    Thanks a lot!

    ReplyDelete
    Replies
    1. Thank you for the email. As we sorted out you can alter the height of the pagenumbers by adjusting the margins of the Pagestyle.
      The other solution: To globally shift the contents of all inputPDFs you must install Ghostscript (and add to the Windows Environment Variables). Then you can set the PDFshift in the "Prefs" of LOSA.

      Delete
  14. Ola, gostaria de saber como inserir sobre o texto apenas a letra do acorde, como por exemplo "A", sem o desenho do acorde, como diagrama, nao sei se me explico. Pois quando uso "ChordInput", alem da letra do acorde ("A") sobre a linha do texto, tambem aparece o desenho do braco violao desenhado logo abaixo. Como faco para que este desenho nao apareca? Obrigado.

    ReplyDelete
    Replies
    1. Ola, if you only want "A" then you can just type "A" as normal text into the document. You don't need to use the ChordDiagram tool. (This "A" can also be transposed with the "ChordTransposer" if you want or need)

      Delete
  15. Hi, I have been using your text frames for the past 2 years, I made a songbook that I and my friends love! The problem is that the book has over 1100 titles by now, and as I enter the text frames, it is becoming more difficult to proccess (I have chords in text frames for about 500 songs). I spitted the book into files of 25 songs, and a master document, so that when working with a song, I don't have a problem. Still, when I load the master book, it takes about 20 minutes to load, and another 20 to export it to pdf. It has become a very unpleasant proccess. I have upgraded to a high end pc but no luck there. I am thinking of migrating to latex (songs package), but I don't want all this work to be waisted (also, I like your approach, and have made several macros to assist me). Do you have any suggestions?

    ReplyDelete
    Replies
    1. Hi,
      sorry to hear that the chords in textframes have such a poor performance with huge projects.
      I suppose LaTex indeed would be the better option and could cope with this.
      But if you don't want to redo all the work then my only idea would be to make usage of the PDF import options of LOSA (you need to install pdftk for that).
      That means that you would export your songs to PDF and "import" that into LOSA. The name of each PDF will automatically imported as TOC entry. So if you export each single Song as PDF you wouldn't have much work.(But I haven't tested LOSA with 500 PDFs) If you have 25-song-PDFs you might have to assign the titles afterwards. But if your 25-song-PDFs already have PDF-Bookmarks (that means they already are formatted as Heading) for each Title then these would be imported as TOC-sub-entries.
      So it works like this: You put all PDFs into a folder called "source" and press "in" in LOSA. Then LOSA imports the titles of each PDF as Heading and all PDFBookmarks as Subheading and creates as many pages as the PDFs have. When you press "out" LOSA will lay all the PDFs from the "source"-folder onto the corresponding pages of the LOSA.pdf
      When you update a PDF in the "source"-folder then LOSA will use that when pressing out. But if this updated PDF has more or less pages or other Sub-Headings then you have to change that manually in LOSA or delete the complete entries of this PDF and reimport by pressing "in".
      Depending on the Layout of your project this might or might not be a possible way to go.
      The bid advantage of this PDF route is that it works with a very small document and is quite fast.
      You can contact me per email if you want (struckkai@gmx.net)

      Delete
    2. Just want to add that I tested LOSA with 500 PDFs and total of 1020 pages and all went correctly. When you press "out" be patient, I does take some time while LOSA collects the information. After that the progressbar at the bottom will show when it starts merging the PDFs.

      Delete
  16. I just want to say a few things about Kai Struck.
    I contacted him having a problem with my song collection project. He replied swiftly, and worked many hours, very hard to solve my problems. But not only that. My project has over 1120 Greek songs, (you can find it at tinyurl.com/to13e ), and I have developed a custom indexing system so that anyone can find a song according to the songs name, its composer, its genre, and its singer. All indexes with hyperlinks. Kai Struck worked with me for weeks to help me improve and automate the indexing. He did all the work, working for hours developing macros for my personal needs. He is swift, has smart ideas, he is effective and most of all committed. Committed to delivering the best possible LOSA for everyone to use freely. Expect a constant improvement of LOSA, as long as there are ideas of improvement, I am sure he will implement them.

    Thank you, Kai, for helping me make my dream come true!
    Perdikakis Spyros

    ReplyDelete
  17. Hi Kay,
    in the very first place THANKS A LOT for your wonderful project, for the many hours you spent on it, and for the will to share it wit all of us: I enormously appreciate!

    I just installed "ChordsDiagrams" on my system (Libreoffice 6.0.7.3 +Ubuntu 18.04.2 ->now with GNOME!) and not all seems to work as it should. Just to mention a few examples:
    -in the "Edit Diagram" Navigator:
    --Number of Frets is either 5 or 12 (shouldn't it be any number from 1 to 12?)
    --Background color of "dots" fields is white AND text is white (I didn't find a way to change none of them)-> Result: I can not read what i do input (However I can get good results entering the "formula")

    I did not find a way to change the background color of ONLY ONE dot (or of a selection of dots) in spite of having seen examples of dots in different colours in the same chart)
    About this last "issue": is it just me, or the problem may have the same rigin as the other issues mentioned?

    In general: The origin of the little "imperfections" may be caused by an incompatibility with GNOME (Ubuntu used to use UNITY in the previous versions)?

    Once more: many thanks and congratulations for your wonderful work!
    Enrico

    ReplyDelete
    Replies
    1. ADDENDUM: ChordDiagrams 1.1.1 ...and I DID find how to change color of a single dot :)
      Enrico

      Delete
    2. Hi Enrico,
      thank you for your nice words and the report!
      "--Number of Frets is either 5 or 12 (shouldn't it be any number from 1 to 12?)"
      You can have any number of frets to appear in the generated Chord Diagram. The number 5 or 12 only affects the editing window. Mostly people only need the smaller window with 5 frets but if you need more then you can change to the 12er version for editing. Regardless which editing-version you use, per default the generated diagrams will show 4 frets as minimum (this is set in the "Prefs"-Button, there you can set the minimum) but if you put dots on 5-12 frets the generated diagram will of course show the required frets.

      "--Background color of "dots" fields is white AND text is white"
      As you found out this could be a bug with the combination of LibreOffice and the OS. A similar problem always was present in Mac OSX until LibreOffice 6.2.4
      (here is my filed bug report
      https://bugs.documentfoundation.org/show_bug.cgi?id=124032
      )
      Perhaps (if your are lucky) this newer LibreOffice version could also be the fix for the GNOME problems.
      There really isn't anything I can do in my code to repair such (external) bugs , sorry.

      "--I did not find a way to change the background color of ONLY ONE dot (or of a selection of dots) in spite of having seen examples of dots in different colours in the same chart)"
      The coloring of specific dots (or any elemnt) is possible by the regular way of editing a "Draw"-drawing. It is not really a part of my program. You just can edit the generated diagram as you can edit any drawing: by selecting individual parts (ctrl-click because the dots are part of a group, don't ungroup!!!) and changing colors etc. in the regular Navigator. You can test if it is a bug of your LibreOffice-OS-Combination by trying to edit any custom made drawing.
      I hope you will find a solution. In any case you can contact me also directly per email (struckkai@gmx.net) if you want to exchange some odt's.

      Delete
  18. AMAZING work!! Very nice tool-

    ReplyDelete
  19. This is the mostest amazing plugin for musicians. Thank you very very much.

    ReplyDelete
  20. Hallo,

    you can download the .zip with the .odt under "What you need: 2...." There is the link
    Or click here: https://goo.gl/ZjN4Uy

    Perhaps you tried to download the documentation !?

    Of course you can use LOSA and PDFtk with all kinds of PDFs, not just music scores.

    Best wishes!!
    Kai

    ReplyDelete
  21. Running LO 7.2 on Fedora 35, PicTool crashes with
    "BASIC runtime error.
    An exception occurred
    Type: com.sun.star.container.NoSuchElementException
    Message: /builddir/build/BUILD/libreoffice-7.2.7.2/basic/source/uno/namecont.cxx:118."

    How do I fix this? Thanks.

    ReplyDelete