Timolution
Banded Mongoose
=====================================================================================================
|THE METHOD IN THIS POST IS OUTDATED! PLEASE LOOK AT POSTS #31 AND #41 FOR THE BEST WAY |
=====================================================================================================
First and foremost, I am not sure if this the right place to put this, so moderators please feel free to ove it to a better subforum if necessary.
So over the last couple of Traveller PDF releases people using macOS or iOS have noted that often covers and other images in the PDFs do not render when viewing the files in the stock Preview app or any other app that uses the native PDFKit renderer. One solution up until now was using a third party application that uses a different rendering engine, be it Adobe Reader or a solution based on the third party PSPDFKit renderer.
Whatever the underlying reason, it is likely a combination of PDFKit being too overtly limited in its support of PDFs that are not conform the published specification and the PDF producing software used by Mongoose producing files not fully adhering to said specification.*
Anyway, it is rather annoying for us Mac/iOS users that we have to use 3rd party viewers to properly read these files, so I went and found a workaround solution which I'll leave here for anyone interested. Note that this will likely only work with files bought from Mongoose directly, as they are not DRMed/locked unlike files bought through Drivethru, and that you will need to use the CLI on your Mac or Linux machine.
One caveat to keep in mind however is that, likely due to the non-compliance of the PDFs to the published standard and the fact that you transform the PDF to a PDF/A standard, this method will sometimes transform text in rasterized characters. I notice this mostly happens on pages where text is overlaying a coloured background and thus probably a consequence of the image layering of those pages. So keep that in mind when you compress the PDF at the final step.
For those that are used to working in the CLI a lot of this will al be very basic level, apologies, but there may be readers out there who have never touched the command line or are not very familiar with a UNIX command prompt.
Mac users should first install a package manager for ease of CLI app installation. You can use Brew or MacPorts, whatever floats your boat, as we only need this to get GhostScript up and running. Linux users can probably get GhostScript from their preferred repo if it is not already installed as part of the default installation.
I personally use Brew, so here's how to install this on your Mac:
!!! I suggest you always work on a copy of the original file just in case !!!
You now have a pdf that is useable by the native macOS/iOS PDF rendering engine. However, you may notice that the file size of this PDF is quite huge, so I would suggest that we compress it down again. Here the amount of compression possible can go from very little to very much and will depend on how much image quality you want to preserve. This can be done through the CLI again, or by using a GUI compression app. I prefer and suggest PDF Squeezer (not affiliated, but this software has never let me down), though there are numerous other GUI options out there that probably can get the job done.
If you want to use a free solution though GhostScript can come to the rescue once again:
Once you see the command prompt again the process is done and you shoud now have a file called compressed_copy.pdf, which should be smaller than the converted pdf we made earlier but still readable in Preview.
You can of course rename your compressed PDF afterwards to whatever name you want.
==========
* Of the latter point I am pretty sure as this is the message you get when running the original PDF through GhostScript:
** Every now and then you might want to update your Brew installation and installed packages by using the following (combined) command:
|THE METHOD IN THIS POST IS OUTDATED! PLEASE LOOK AT POSTS #31 AND #41 FOR THE BEST WAY |
=====================================================================================================
First and foremost, I am not sure if this the right place to put this, so moderators please feel free to ove it to a better subforum if necessary.
So over the last couple of Traveller PDF releases people using macOS or iOS have noted that often covers and other images in the PDFs do not render when viewing the files in the stock Preview app or any other app that uses the native PDFKit renderer. One solution up until now was using a third party application that uses a different rendering engine, be it Adobe Reader or a solution based on the third party PSPDFKit renderer.
Whatever the underlying reason, it is likely a combination of PDFKit being too overtly limited in its support of PDFs that are not conform the published specification and the PDF producing software used by Mongoose producing files not fully adhering to said specification.*
Anyway, it is rather annoying for us Mac/iOS users that we have to use 3rd party viewers to properly read these files, so I went and found a workaround solution which I'll leave here for anyone interested. Note that this will likely only work with files bought from Mongoose directly, as they are not DRMed/locked unlike files bought through Drivethru, and that you will need to use the CLI on your Mac or Linux machine.
One caveat to keep in mind however is that, likely due to the non-compliance of the PDFs to the published standard and the fact that you transform the PDF to a PDF/A standard, this method will sometimes transform text in rasterized characters. I notice this mostly happens on pages where text is overlaying a coloured background and thus probably a consequence of the image layering of those pages. So keep that in mind when you compress the PDF at the final step.
For those that are used to working in the CLI a lot of this will al be very basic level, apologies, but there may be readers out there who have never touched the command line or are not very familiar with a UNIX command prompt.
Mac users should first install a package manager for ease of CLI app installation. You can use Brew or MacPorts, whatever floats your boat, as we only need this to get GhostScript up and running. Linux users can probably get GhostScript from their preferred repo if it is not already installed as part of the default installation.
I personally use Brew, so here's how to install this on your Mac:
- Copy and paste the below command in your Terminal app, press enter and follow the instructions that will appear**:
Code:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Once Brew is installed, go ahead and install GhostScript by pasting the following command in the Terminal and pressing enter:
Code:
brew install ghostscript
Now that GhostScript is installed we can 'fix' the wayward Traveller PDF so it behaves normally when being rendered through PDFKit:!!! I suggest you always work on a copy of the original file just in case !!!
- Put the copy of the probematic PDF in a folder of your choosing and name it original_copy.pdf (for ease of following along)
- In your terminal type
Code:
cd
- Drag the folder with your PDF copy onto the Terminal window and press enter
- The prompt in your terminal should now read
Code:
your_username@your_computername name_of_folder_you_just_dragged %
- If that is the case you have succesfully changed your working directory to the folder containing our PDF copy. If not, try to redoing the above steps.
- Now we will convert the copy of the problem PDF to a PDF/A file using Ghostscript (note that this will hugely inflate the size of the file, up to 500-600%) by copying and pasting the following command in the Terminal follwed by pressing enter:
Code:
gs -dPDFA -dBATCH -dNOPAUSE -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=2 -sOutputFile=converted_copy.pdf original_copy.pdf
- A lot of text will now start scrolling in your terminal window, with occasional errors and warnings. Just let it work until you see the command prompt again
Code:
your_username@your_computername name_of_folder_you_just_dragged %
- In the folder where you put your copy oif the original pdf there should now be a very large file named converted_copy.pdf. You can confirm now that Preview will open this pdf and in fact show all images as intended.
You now have a pdf that is useable by the native macOS/iOS PDF rendering engine. However, you may notice that the file size of this PDF is quite huge, so I would suggest that we compress it down again. Here the amount of compression possible can go from very little to very much and will depend on how much image quality you want to preserve. This can be done through the CLI again, or by using a GUI compression app. I prefer and suggest PDF Squeezer (not affiliated, but this software has never let me down), though there are numerous other GUI options out there that probably can get the job done.
If you want to use a free solution though GhostScript can come to the rescue once again:
- Make sure you are still in the correct directory (the one where the newly made PDF is located)
- Copy paste the following command and press enter ***:
Code:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=2 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile=compressed_copy.pdf converted_copy.pdf
- Again text will start scolling and this is a slow process (one of the reasons I swear by PDF Squeezer as it is a lot faster), so go grab yourself a cuppa coffee or something in the meantime.
Once you see the command prompt again the process is done and you shoud now have a file called compressed_copy.pdf, which should be smaller than the converted pdf we made earlier but still readable in Preview.
You can of course rename your compressed PDF afterwards to whatever name you want.
==========
* Of the latter point I am pretty sure as this is the message you get when running the original PDF through GhostScript:
The following errors were encountered at least once while processing this file:
error executing PDF token
**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> PDFlib+PDI 9.1.1p3 (PHP7/Linux-x86_64) <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
** Every now and then you might want to update your Brew installation and installed packages by using the following (combined) command:
Code:
brew update; brew upgrade; brew cleanup; brew doctor
*** You can specify the amount of compression by changing the -dPDFSETTINGS parameter in the command. You will have to search a bit yourself which option has the best file size versus image quality ratio for your preference, but the following options are possible:-dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook (low quality, 150 dpi images)
-dPDFSETTINGS=/printer (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default (almost identical to /screen)
Last edited: