Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

Download or installation problems? Try these steps
Problems after upgrading to NeoOffice 2017? Try these steps


Support
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


RSS Feeds
· Announcements Only
· All Posts


  
NeoOffice :: View topic - PostScript output / Printing redirecton (for extendedPDF)
PostScript output / Printing redirecton (for extendedPDF)
 
Post new topic   Reply to topic    NeoOffice Forum Index -> NeoOffice Testing
View previous topic :: View next topic  
Author Message
liyanage
Guest





PostPosted: Thu Jan 06, 2005 2:44 am    Post subject: PostScript output / Printing redirecton (for extendedPDF) Reply with quote

NeoOffice/J hooks into the OS X printing subsystem very cleanly, which is great in general.

Where it gets in my way is when I try to use the extendedPDF macro, which seems to require the ability to get at the raw, unprocessed PostScript output produced by OpenOffice. In The Mac-X11 version, this macro does its job beautifully, but in NeoOffice/J, thinks work a bit differently I guess, no PostScript file is generated at the location expected by the macro.

It seems that another side effect of this redirection is that all my embedded EPS vector images do not print at all, they are simply omitted and white space ends up where the image should be. Again, this does work flawlessly in the X11 version of OpenOffice on Mac OS X.

Is there any way to get the regular, non-OS X specific behavior so that the macro works?


[/img]
Back to top
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Thu Jan 06, 2005 9:33 am    Post subject: Re: PostScript output / Printing redirecton (for extendedPDF Reply with quote

liyanage wrote:
NeoOffice/J hooks into the OS X printing subsystem very cleanly, which is great in general.


Hi Marc,

You've poked into the hornet's nest now. There was a lot of discussion just before the beta came out. Lots of people came out to help me set it up. While I haven't gotten it to work myself yet (didn't bother since Xmas), I think all the ingredients are in this thread:

http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=901&highlight=

I hope you don't need to try as much as I have Smile. The most important thing that I missed was about properly naming the .ps file. As for EPS images, I recall a bug about that, but if it is fixed in OOo, I'll leave it up to Patrick to explain why it is not working in NeoOffice.

Best wishes,
Oscar

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
View user's profile Send private message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Thu Jan 06, 2005 10:29 am    Post subject: Reply with quote

Heh, I knew I needed to get that all distilled and into the wiki in a nice clean version, and I intended to drop Marc a line when it was up Sad. But there still seemed to be some lingering issues for some folks...and, well, Beta arrived Smile

Aside from the EPS part, I can verify that it extendedPDF does work (as I claimed a number of times in the thread Oscar linked to Smile)

Perhaps we can use this as a chance to get a nice, clean set of working instructions Smile

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
liyanage
Guest





PostPosted: Fri Jan 07, 2005 8:09 am    Post subject: Reply with quote

Thanks for the informative feedback so far. I even read that thread that was mentioned above (and added the AppleScript improvements to my web page) but forgot it again in the mean time Smile

I guess I should have provided a bit more info about what I tried. I did indeed try that "Save as File" thing with the PostScript option. When I give the file the name that is expected by the extendedPDF macro (i.e. document name with a .ps suffix), it even runs through automatically, i.e. it invokes my helper shell script that automatically invokes Acrobat Distiller, I don't have to drag-and-drop the .ps onto Distiller.

The important extendedPDF features do indeed work, i.e. TOC entries which link into the document, hierarchical PDF bookmarks etc.

However, EPS images definitely do not make it through to the result, which is the absolute show-stopper for me. The (technical) documents I write contain lots of EPS diagrams / illustrations.

I also noticed that when I export the PostScript code this way (using Save to File), the page margins are too large, i.e my footer lines don't even appear in the output because they seem to lie outside of the printable area as defined in the generic printer description and are therefore cut off. I guess I could hack around this by changing the PPDs, but I don't want to do that right now.

Somehow I really suspect that the PostScript code is *not* the one produced by the OpenOffice engine as in the X11 version. My guess is that NeoOffice does its drawing using Quartz / Core Graphics and then hands that off to the OS X printing subsystem (in PDF). That in turn converts it from PDF to PS (using the cgpdf2ps filter), but this path means that there is no way that the EPS images make it through into the final PostScript code which is processed by the extendedPDF macro, and subsequently by Distiller (or ghostscript). It seems that the "pdfmark" commands added by the extendedPDF macro at the end of the document work either way, i.e. with the PostScript code generated by cgpdf2ps and with the native OpenOffice PS code.

When I look at the PostScript code generated by NeoOffice, the crator is Core Graphics:

%%Creator: (NeoOffice/J: cgpdftops CUPS filter)

When I look at the X11-OpenOffice PS code, it looks different:

%%Creator: OpenOffice.org 1.1.2


What *is* affected, however, are EPS images.

In The X11-OpenOffice PostScript code, I see my EPS:

...
%%BeginDocument: futureLAB-Logo.eps
%!PS-Adobe-3.1 EPSF-3.0
... (long stream with the image code)


This seems to get stripped in NeoOffice, again my suspicion is that in NeoOffice the native PostScript generation code, which would usually embed the EPS images into the output stream in this way, is completely bypassed by Core Graphics imaging stuff. Is this correct?
Back to top
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Fri Jan 07, 2005 8:42 am    Post subject: Reply with quote

liyanage wrote:
I also noticed that when I export the PostScript code this way (using Save to File), the page margins are too large, i.e my footer lines don't even appear in the output because they seem to lie outside of the printable area as defined in the generic printer description and are therefore cut off. I guess I could hack around this by changing the PPDs, but I don't want to do that right now.


I seem to recall someone else complaining about this as well. But there is no bug open on it currently.

liyanage wrote:
This seems to get stripped in NeoOffice, again my suspicion is that in NeoOffice the native PostScript generation code, which would usually embed the EPS images into the output stream in this way, is completely bypassed by Core Graphics imaging stuff. Is this correct?


With any luck, Patrick can tweak some image embedding options and we're good to go, but this could be a bit too optimistic. I wonder, if you use 'Direct export to PDF' or print and 'Save as PDF', do you get the EPS images in that stream? In that case, the EPS images are handled initially, but lost in a later conversion. Anyway, I think I'll back off now and let the experts handle this..

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
View user's profile Send private message
liyanage
Guest





PostPosted: Fri Jan 07, 2005 8:44 am    Post subject: Reply with quote

BTW, on a related note...

About a year ago I already fought with this inability to get at an application's native PostScript code in Mac OS X. Back then, I wanted to use Word's "print fields" feature to inject pdfmark commands into its PostScript output. This is a well-known technique from the old days...

Unfortunately, on Mac OS X the PostScript code created using "Save to File" is not what MS Word produces and any custom code injected using print fields does not end up there, probably again because Word's native PostScript generation is not invoked.
Back to top
roberts
Agent


Joined: Dec 13, 2004
Posts: 13

PostPosted: Tue Jan 11, 2005 4:19 pm    Post subject: Reply with quote

I believe this thread
http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=117

contains a good discussion of the issues.
Back to top
View user's profile Send private message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Fri Jan 14, 2005 1:08 am    Post subject: Reply with quote

OK y'all, I've fleshed out the tutorials for OOo and Neo/J (as things stand now):

http://neowiki.sixthcrusade.com/index.php/Using_extendedPDF_with_NeoOffice/J
http://neowiki.sixthcrusade.com/index.php/Using_extendedPDF_with_OpenOffice.org/X11

Have a look and see how they read. Have I missed anything?

Smokey

P.S. Good catch on that old EPS issue, roberts!

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki


Last edited by sardisson on Mon Apr 25, 2005 12:35 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Sun Jan 16, 2005 3:22 am    Post subject: Reply with quote

sardisson wrote:
Have a look and see how they read. Have I missed anything?


Hi Smokey,

Thanks, it is pretty good to follow. Problem is that I must have done something wrong somewhere. I got the following errors:

Code:
There was an error running GhostScript.
    Please check that your configuration is correct.
    (Command line: /Users/oscarvanvliet/Library/Printers/oo_pdf_helper.pl -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer "-sOutputFile=/Users/oscarvanvliet/Desktop/testdoc.tmp" -c .setpdfwrite -f "/Users/oscarvanvliet/Desktop/testdoc.ps")
System error 0 occurred: Fehler 0: Kein Fehlertext verfuegbar! at line: 696


Any thoughts? I checked and the script is executable. My version is:

Code:

#!/usr/bin/perl
#
# OpenOffice helper script to invoke Adobe Acrobat Distiller
# in place of ghostscript on Mac OS X from the extendedPDF
# Macro (http://www.jdisoftware.co.uk/pages/epdf-home.php).
#
# Install this somewhere on your machine, make it executable
# and then configure its path instead of the "gs" command
# in the "Configuration" dialog of the extendedPDF GUI.
#
# Written by Marc Liyanage, see http://www.entropy.ch
#
#
use warnings;
use strict;

use IO::File;

my ($outputfile) = map {/^-sOutputFile=(.+$)/; $1 ? $1 : ()} @ARGV;
my ($inputfile) = $ARGV[-1];


my $applescript = <<"EOF";

with timeout of 600 seconds
 tell application "Acrobat Distiller 7.0"
  Distill destinationPath "$outputfile" sourcePath "$inputfile"
 end tell
end timeout


EOF

my $pipe = IO::File->new("|/usr/bin/osascript");
$pipe->print($applescript);
$pipe->close();


I wonder if it is the compatibility settings that I used (and how do I scrap those) or something utterly unrelated. I don't have anything in my console or crash logs...
Back to top
View user's profile Send private message
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Sun Jan 16, 2005 3:32 am    Post subject: Almost works Reply with quote

Anyway, I dropped the .ps file on Distiller manually and it created a bookmarked PDF...

Marc, do you have any idea what happened? I am thinking my helper script is iffy.

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
View user's profile Send private message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Sun Jan 16, 2005 3:41 am    Post subject: Reply with quote

GhostScript gives the most unhelpful messages. Evil or Very Mad Often it seems to throw that same thing up when something is not found.... But what does the last line (in Dutch) say in English? (I have a little Dutch in me, but it's about five generations back, so not enough to speak/read Smile).

I'm still on Distiller 6.0.2, so I also suppose 7 might be the "problem."

I'm a bit tired at the moment, so I'll have another look later...

Given all the issues, though, I'm really beginning to wonder if my getting it to work was just a fluke! Smile

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Sun Jan 16, 2005 5:50 am    Post subject: Reply with quote

sardisson wrote:
GhostScript gives the most unhelpful messages. Evil or Very Mad Often it seems to throw that same thing up when something is not found.... But what does the last line (in Dutch) say in English? (I have a little Dutch in me, but it's about five generations back, so not enough to speak/read Smile).


Actually it isn't in Dutch. It is German and I haven't a clue why. As to it's meaning:

Code:
Fehler 0: Kein Fehlertext verfuegbar!


Code:
Error 0: No error text available!


Which is, as you say, stunningly unhelpful. But the .ps file is there so I doubt that it is Ghostscript that is giving the error. I think it is hardwired to say Ghostscript, rather than what is actually used (Acrobat Distiller).

sardisson wrote:
I'm still on Distiller 6.0.2, so I also suppose 7 might be the "problem." I'm a bit tired at the moment, so I'll have another look later...


No worries. But I recall seeing the same bug with 6.0 after much fiddling (and then I gave up for Xmas).

sardisson wrote:
Given all the issues, though, I'm really beginning to wonder if my getting it to work was just a fluke! Smile


Yeah, well, I'm sure it can be made to work.. Just a wee bit of tracking and advice from clever types like you and Marc.

Best wishes,
Oscar

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
View user's profile Send private message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Mon Jan 17, 2005 3:27 am    Post subject: Reply with quote

Well, aside from that strange issue of your resulting document name wanting to be testdoc.tmp instead of testdoc.pdf....

The issue seems to be the latter part of the script:

Code:
my $pipe = IO::File->new("|/usr/bin/osascript");
print $pipe $applescript;
$pipe->close();


That code works. The new version you're using throws errors. I'm not sure why Marc changed it—perl is well beyond my grasp Smile

Hopefully this gets it working for you (if so, more changes for the wiki). Otherwise I really must have some good karma going on!

On another note, I'm not sure that the quality settings in the extendedPDF setup matter, only the ones in Distiller. I had left my ePDF settings 1.3/Default and the PDFs all came out 1.4/Standard, since that's what my default Distiller settings are. (It *does* matter for using gs, but gs doesn't work with Neo/Apple-generated .ps files.) Yet another thing to add to the tutorial....

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
ovvldc
Captain Naiobi


Joined: Sep 13, 2004
Posts: 2352
Location: Zürich, CH

PostPosted: Mon Jan 17, 2005 5:05 pm    Post subject: Reply with quote

sardisson wrote:
The issue seems to be the latter part of the script:

Code:
my $pipe = IO::File->new("|/usr/bin/osascript");
print $pipe $applescript;
$pipe->close();


That code works. The new version you're using throws errors. I'm not sure why Marc changed it—perl is well beyond my grasp Smile

Hopefully this gets it working for you (if so, more changes for the wiki). Otherwise I really must have some good karma going on!


Man, you are on the way to Buddhahood, considering your Karma.
Not me, apparently...

_________________
"What do you think of Western Civilization?"
"I think it would be a good idea!"
- Mohandas Karamchand Gandhi
Back to top
View user's profile Send private message
sardisson
Town Crier
Town Crier


Joined: Feb 01, 2004
Posts: 4588

PostPosted: Tue Jan 18, 2005 12:15 am    Post subject: Reply with quote

ovvldc wrote:
Man, you are on the way to Buddhahood, considering your Karma.
Not me, apparently...


Well, THarf! Sad I'm out of ideas. Does the ever-so-helpful GS error still claim that your resulting file is going to be testdoc.tmp rather than testdoc.pdf?

Maybe the ePDF macro has changed since I downloaded and installed it, too? I (ever-so-helpfully) see no date or version number in its About box. However, from the downloaded file's URL (thanks iCab!) I see it's 0.9.3. I assume you're using 1.2? I'll give that a spin later this week, hopefully, and see if we can't learn more Smile

Smokey

_________________
"[...] whether the duck drinks hot chocolate or coffee is irrelevant." -- ovvldc and sardisson in the NeoWiki
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NeoOffice Forum Index -> NeoOffice Testing All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.03 Seconds