Mobileread
Tools to test pdf compatibility and speed?
#11  MarjaE 06-13-2019, 11:32 PM
One big difference is that I compress images with k2pdfopt, but due to various bugs, I no longer compress images with ghostscript. If image compression is the biggest difference, then

(1) I can compare the sizes of

(compressed) k2pdfopt -ui -mode copy -dev dx -o %_k2opt\ dx

with

(uncompressed) k2pdfopt -ui -mode copy -o %_k2opt\ copy

using the relative sizes as a rough proxy for the relative delays. But I've got some with a 4.0:1 ratio and no trouble, and others with a 2.4:1 ratio and freezes.

(2) I can use

(uncompressed) k2pdfopt -ui -mode copy -p 1-10 -o %_k2opt\ test

using the sizes as a rough proxy for the delays. But I've got some freeze-prone files at the 2.2 MB range and tolerably fast ones at 4.4 MB.
Reply 

#12  MarjaE 10-24-2019, 04:41 AM
I think I finally found a way to pre-check which pdfs are likely to take forever on my Kindle, or other slower devices. [P.S. gtime and gs are gnu-time and ghostscript.]

gtime -p -o input.pdf-timed.txt gs -dNOPAUSE -dQUIET -dBATCH input.pdf

In Mac Automator:

Application recieves files and folders as input.

Run Shell Script.

Set to use bash and recieve input as arguments, then:

for f in "$@"
do
suffix="-timed.pdf"
base=`basename "$f" .pdf`
outputfile=$base$suffix
/usr/local/bin/gtime -p -o "$f"-timed.txt /usr/local/bin/gs -dNOPAUSE -dQUIET -dBATCH "$f"
done

It outputs a txt file listing how long it took for ghostscript to run through the original file. I don't think the suffix, base, and outputfile lines are actually needed.
Reply 

 « First  « Prev   (2/2)
Today's Posts | Search this Thread | Login | Register