zackw / pdfsizeopt

Automatically exported from code.google.com/p/pdfsizeopt
0 stars 0 forks source link

pdfsizeopt.py (multivanet) fails without access to the window system #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Login to Mac OS X system through ssh, as an user different to one uses the 
desktop at the moment
2. Run pdfsizeopt, with multivalent enabled

What is the expected output? What do you see instead?

pdfsizeopt should work, but fails with multivalent with Java stack trace:

info: executing Multivalent to optimize PDF: java -cp 
/Users/publisher/bit-pdfsizeopt/Multivalent20060102.jar tool.pdf.Compress 
-nopagepiece -noalt -jpeg pso.conv.mi.tmp.pdf
file:/Users/publisher/bit-pdfsizeopt/pso.conv.mi.tmp.pdf, 7681154 bytes
PDF 1.5, producer=Apple pstopdf, creator=null
Mon Jan 30 13:25:42 bitmacports java[23874] <Error>: kCGErrorFailure: Set a 
breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Exception in thread "main" java.lang.InternalError: Can't connect to window 
server - not enough permissions.
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1045)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
        at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
        at java.awt.Color.<clinit>(Color.java:263)
        at tool.pdf.Compress.recodeRawAsDCT(Unknown Source)
        at tool.pdf.Compress.recodeImage(Unknown Source)
        at tool.pdf.Compress.compress2(Unknown Source)
        at tool.pdf.Compress.compress(Unknown Source)
        at tool.pdf.Compress.writeUni(Unknown Source)
        at tool.pdf.Compress.writeFile(Unknown Source)
        at tool.pdf.Compress.main(Unknown Source)
info: Multivalent failed, status=0x100
Traceback (most recent call last):
  File "pdfsizeopt.py", line 7014, in <module>
    main(sys.argv)
  File "pdfsizeopt.py", line 7006, in main
    do_generate_xref_stream=do_generate_xref_stream)
  File "pdfsizeopt.py", line 6776, in SaveWithMultivalent
    assert 0, 'Multivalent failed (status)'
AssertionError: Multivalent failed (status)

What version of the product are you using? On what operating system?

$ uname -a
Darwin bitmacports 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 
2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

Original issue reported on code.google.com by ole...@gmail.com on 30 Jan 2012 at 12:29

GoogleCodeExporter commented 8 years ago
For me, adding "-Djava.awt.headless=true" to java command line works.

Original comment by ole...@gmail.com on 30 Jan 2012 at 12:30

GoogleCodeExporter commented 8 years ago
Fixed in r173.

Thank you for reporting this issue, including all the relevant details and 
proposing a fix.

Original comment by pts...@gmail.com on 31 Jan 2012 at 8:43