Skip to content

Instantly share code, notes, and snippets.

@yakovsh
Created January 24, 2016 05:05
Show Gist options
  • Save yakovsh/d4016cd9272d2e7b9a8c to your computer and use it in GitHub Desktop.
Save yakovsh/d4016cd9272d2e7b9a8c to your computer and use it in GitHub Desktop.

Revisions

  1. yakovsh revised this gist Jan 24, 2016. No changes.
  2. yakovsh created this gist Jan 24, 2016.
    15 changes: 15 additions & 0 deletions 2007_07_25-djvu2pdf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/sh
    #
    # Here is the software that is needed for the conversion to take place:
    # 1. DjVuLibre .
    # 2. LibTiff .
    #
    # NOTE: The ddjvu utility has an option to convert specific layers. One common mistake is to convert only the mask layer
    # or the foreground layer . Technically speaking, the mask layer is the one that should have the actual text but in
    # practice I have seen that the the DjVu encoder occasionally puts portions of the text in the background layer. Thus,
    # if you only take the foreground or mask layers, you will lose those bits in the background. If your specific files
    # don't have that issue, that you should use the layer switch since it reduces file size and increases readibility.
    #
    djvu -verbose -format=tif %1 temp.tif
    tiff2pdf temp.tif -o %2
    rm temp.tif