[
https://issues.apache.org/jira/browse/SOLR-10298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15939333#comment-15939333
]
Hoss Man edited comment on SOLR-10298 at 3/24/17 12:37 AM:
-----------------------------------------------------------
bq. Maybe, since ghostscript's contribution in the optimization phase seems
limited to image scaling, ...
it's definitely not just an issue of image scaling -- note cassandra's comments
about {{/FlateDecode}} -- ghostscript is re-writting the postscript text blocks
to use compressed text.
here's a quick comparison I just did on the jira/solr-10290 branch...
* 27M refguide-size.normal.pdf
** default asciidoctor-pdf output via {{ant build-pdf}}
** gziped: 7.9M
* 22M refguide-size.all-pngs-are-1px.pdf
** replaced all PNG files in {{src/images}} with a 1px image && {{ant
build-pdf}}
** gziped: 2.3M
* 13M refguide-size.normal-optimized.pdf
** default asciidoctor-pdf output via {{ant build-pdf}} (27M) && run
{{optimize-pdf}} on result
** gziped: 9.2M
* 3.8M refguide-size.all-pngs-are-1px-optimized.pdf
** replaced all PNG files with a 1px image, then {{ant build-pdf}} (22M) && run
{{optimize-pdf}} on result
** gziped: 2.7M
So clearly there's a lot to be gained from letting {{gs}} do some of it's
default page compression and font inlining/subseting (even if we don't want
care about programmatic image scaling and/or manually change the images
ourselves in the repo)
But an alternative to worrying about using compression inside the PDF might be
to just ship the PDF inside of a zip file -- which we can easily do from ant.
*NOTE:* _edited to include the gzipped sizes_
was (Author: hossman):
bq. Maybe, since ghostscript's contribution in the optimization phase seems
limited to image scaling, ...
it's definitely not just an issue of image scaling -- note cassandra's comments
about {{/FlateDecode}} -- ghostscript is re-writting the postscript text blocks
to use compressed text.
here's a quick comparison I just did on the jira/solr-10290 branch...
* 27M refguide-size.normal.pdf
** default asciidoctor-pdf output via {{ant build-pdf}}
* 22M refguide-size.all-pngs-are-1px.pdf
** replaced all PNG files in {{src/images}} with a 1px image && {{ant
build-pdf}}
* 13M refguide-size.normal-optimized.pdf
** default asciidoctor-pdf output via {{ant build-pdf}} (27M) && run
{{optimize-pdf}} on result
* 3.8M refguide-size.all-pngs-are-1px-optimized.pdf
** replaced all PNG files with a 1px image, then {{ant build-pdf}} (22M) && run
{{optimize-pdf}} on result
So clearly there's a lot to be gained from letting {{gs}} do some of it's
default page compression and font inlining/subseting (even if we don't want
care about programmatic image scaling and/or manually change the images
ourselves in the repo)
> Reduce size of new Ref Guide PDF
> --------------------------------
>
> Key: SOLR-10298
> URL: https://issues.apache.org/jira/browse/SOLR-10298
> Project: Solr
> Issue Type: Sub-task
> Security Level: Public(Default Security Level. Issues are Public)
> Components: documentation
> Reporter: Cassandra Targett
>
> The new Ref Guide PDF is ~31Mb in size, which is more than 2x the current PDF
> produced by Confluence (which is 14Mb).
> The asciidoctor-pdf project has a script to optimize the PDF, mostly by
> scaling down images. When I run this tool on the new PDF, the size is reduced
> to ~18Mb. (More info on this script:
> https://github.com/asciidoctor/asciidoctor-pdf#optional-scripts).
> Some of the current image files are very large in size, so I believe that by
> scaling the images down, we can make the size smaller without adding a step
> in the build to run the optimize script programmatically (it also has a
> dependency on GhostScript, so it would be nice to not add another dependency
> if it can be avoided).
> The new PDF is also about 300 pages longer, but this issue is primarily
> concerned with file size. However, reducing the number of pages will also
> make it smaller. A few things that could be tried to reduce the # of pages:
> * Reduce font sizes
> * Increase page margins
> * Review options for when a forced page-break is used and modify if possible
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]