Bug 89827 - [patch] fix pdftops git 30mar15 regression where -passfonts and some other options no longer have an effect
Summary: [patch] fix pdftops git 30mar15 regression where -passfonts and some other op...
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-30 19:43 UTC by William Bader
Modified: 2015-05-14 18:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to fix the problem (10.60 KB, patch)
2015-03-30 19:43 UTC, William Bader
Details | Splinter Review
Sample PDF to show the problem (2.27 KB, application/pdf)
2015-03-30 19:58 UTC, William Bader
Details

Description William Bader 2015-03-30 19:43:00 UTC
Created attachment 114734 [details] [review]
patch to fix the problem

Recent changes to the command line processing moved some options from GlobalParams to PSOutputDev.
The options used to be set by calling setters in GlobalParams before creating the PSOutputDev.
Now the options are set by calling setters in PSOutputDev after it is created.
The problem is that PSOutputDev() calls init() which uses options that now can not be set until later after PSOutputDev() returns.
These patches split some of the code of init() into a new postInit() that is automatically called later after the pdftops main program has had a chance to set the command line options.
When I was looking through the code, I also fixed a misspelling of sanitizedTitle as sanitizedTile.
Comment 1 William Bader 2015-03-30 19:58:26 UTC
Created attachment 114736 [details]
Sample PDF to show the problem

The attached PDF uses the font Spartan-HeavyClassified but does not embed it.
You can use this file to very that the pdftops -passfonts option no longer works and that these patches fix it.
Some of the other options also no longer work correctly.

pdftops embeds a substituted font by default.
The PS file is 1.2 MB, and gs shows the substituted font even if a file for the original font is available.
$ pdftops /u/displayads/80698010-killeen-subst.pdf embed.ps
$ ls -l embed.ps 
-rw-rw-rw- 1 william william 1266770 Mar 30 21:46 embed.ps
$ gs -sDEVICE=bit -sOutputFile=junk -dNOPAUSE embed.ps -c quit
GPL Ghostscript RELEASE CANDIDATE 2 9.16 (2015-03-20)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
$

With -passfonts, the PS file is 19 KB, and gs will show the original font if the font file is available.
$ pdftops -passfonts /u/displayads/80698010-killeen-subst.pdf pass.ps
$ ls -l pass.ps 
-rw-rw-rw- 1 william william 18779 Mar 30 21:46 pass.ps
$ gs -sDEVICE=bit -sOutputFile=junk -dNOPAUSE pass.ps -c quit
GPL Ghostscript RELEASE CANDIDATE 2 9.16 (2015-03-20)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file %rom%Resource/Font/Spartan-HeavyClassified.
Loading Spartan-HeavyClassified font from /u/fonts/Spartan-HeavyClassified... 6467804 4887585 2374160 1075919 1 done.
$
Comment 2 Albert Astals Cid 2015-05-14 18:06:59 UTC
Pushed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.