Postscript import (PS, EPS, PDF): EPS fails

Discuss the word processor
Post Reply
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

Dear all,

many scientific data analysis tools such as "NCL" and "ferret" produce only graphical output in a format from the postscript family: .ps, .eps (no embedded preview) or .pdf.

Via "Insert" -> "Picture" -> "From File..." Writer, Impress and other OOo modules only allow .eps postscript graphics import, not .ps or .pdf. Even so, on trying to insert my NCL-produced .eps files I always get the error message "Unknown graphics format". However, these .eps files look fine when I process them e.g. with LyX (LaTeX) on Linux or Windows.

Judging from the OOo documentation, especially OOo issue tracker, forums and newsgroups that I had been browsing for this issue, I would have expected that my OOo version 2.3.1 would at least draw an empty bounding box and print properly to postscript printers. Could someone please explain why I get this error?

Tools for manual postscript (.ps, .eps, .pdf) conversion to OOo-compatible graphics formats are available on various operating systems, but knowing that even MS Powerpoint has a decent eps import filter these days, to me it would seem a little nuisance to do this manual conversion for every single postscript file on a daily basis... Therefore, going one step further, I'd also like to know whether native postscript import is a feature scheduled for a future OOo release, and whether there is a corresponding OOo issue that I could support with my vote.

Looking forward to oyour answers,
Seasonal greetings,
Marcus
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: postscript import (PS, EPS, PDF): EPS fails

Post by foxcole »

letmo wrote:Via "Insert" -> "Picture" -> "From File..." Writer, Impress and other OOo modules only allow .eps postscript graphics import, not .ps or .pdf.
Those last two are not graphic file formats. Insert> Picture can only work with supported graphic formats. Currently, EPS, I believe, is not well supported by Writer; you'd have to do the intermediary step you were referring to, to import the EPS into Draw and convert it to a format Writer can use.

Writer is a word processor. Postscript is a printer language. To read and display Postscript is no simple feat, and Adobe owns the rights to all Postscript formats. This why separate programs are needed to open and read PDF files; they use printer drivers to interpret and display the Postscript printer code. Word processors aren't designed for that purpose.

so even the ability to create the printer-language version of a document falls under certain legal restrictions. Because Writer is a word processor, designed for content creation, it's not able or allowed to parse out a printer language. It can insert a PDF file using OLE (Insert> Object> OLE object), which you should be able to do if your computer has a program that can edit the object. That's one of the restrictions of OLE links, because the nature of OLE is to link to files created by other applications and be able to edit the object using its native program, without leaving the host program. It's not good enough to have a display program, such as a PDF reader, for an OLE linked object. I can link to a PDF file from Writer because Acrobat Professional resides on this computer, but folks who only have readers (FoxIt or Adobe Reader) are unable to do so.

As to why you're unable to see the bounding box for EPS files, I'm guessing it's a problem with the source of the EPS files... if they're not native Illustrator files, it's possible that something is being added or changed in the file header, that Writer can't recognize. Would you be able to post a sample EPS somewhere such as http://www.mediafire.com/? It might help to have others test to see if we get the same results.
letmo wrote:Tools for manual postscript (.ps, .eps, .pdf) conversion to OOo-compatible graphics formats are available on various operating systems, but knowing that even MS Powerpoint has a decent eps import filter these days, to me it would seem a little nuisance to do this manual conversion for every single postscript file on a daily basis...
Word itself can't read PDF or other Postscript files... it will try to do the same kind of file conversion as you're seeing with Writer, for the same reasons noted above. PDF or Postscript is not a supportable format in a document editor. You'll have to do the file conversion no matter what word processor you're in.
letmo wrote:Therefore, going one step further, I'd also like to know whether native postscript import is a feature scheduled for a future OOo release, and whether there is a corresponding OOo issue that I could support with my vote.
I doubt you'll ever see this capability in OpenOffice or Microsoft Office or any other non-Adobe word processor. To import means to convert to a format editable by the application you're importing into, and Adobe holds tight reins over licenses to edit PDF and other PS formats... rightfully so. The ability to edit them is how Adobe continues to earn profits on its proprietary formats. Why would they give that away?

I'm guessing that because you're asking someone to search for issues, you're not aware of where to look for bugs and requests. Here is a link to the Issue Tracker. You can search it any time, but will need to register and log in, of course, if you wish to vote or add comments to issues:
http://qa.openoffice.org/issue_handling ... ssion.html

I recommend the Advanced Search option; you can narrow the search to just the Word Processor features, if desired, and
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Re: postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

Dear foxcole,

thanks for your speedy reply. It helps me to clarify some of my statements.
foxcole wrote:It can insert a PDF file using OLE (Insert> Object> OLE object), which you should be able to do if your computer has a program that can edit the object. That's one of the restrictions of OLE links, because the nature of OLE is to link to files created by other applications and be able to edit the object using its native program, without leaving the host program. It's not good enough to have a display program, such as a PDF reader, for an OLE linked object. I can link to a PDF file from Writer because Acrobat Professional resides on this computer, but folks who only have readers (FoxIt or Adobe Reader) are unable to do so.
Yes, you are right. I use both readers you mentioned but not Acrobat Pro, thus PDF OLE is not an option for me.
foxcole wrote:As to why you're unable to see the bounding box for EPS files, I'm guessing it's a problem with the source of the EPS files... if they're not native Illustrator files, it's possible that something is being added or changed in the file header, that Writer can't recognize. Would you be able to post a sample EPS somewhere such as http://www.mediafire.com/? It might help to have others test to see if we get the same results.
Thank you for this suggestion. If I got it right, you should be able to access this file from http://www.mediafire.com/?ergww9kwct1. Your comments are greatly appreciated, since I use the producing application "NCL" a lot (NCL graphics output formats: http://www.ncl.ucar.edu/Document/Graphi ... _wks.shtml).
foxcole wrote:
letmo wrote:Tools for manual postscript (.ps, .eps, .pdf) conversion to OOo-compatible graphics formats are available on various operating systems, but knowing that even MS Powerpoint has a decent eps import filter these days, to me it would seem a little nuisance to do this manual conversion for every single postscript file on a daily basis...
Word itself can't read PDF or other Postscript files... it will try to do the same kind of file conversion as you're seeing with Writer, for the same reasons noted above. PDF or Postscript is not a supportable format in a document editor. You'll have to do the file conversion no matter what word processor you're in.
letmo wrote:Therefore, going one step further, I'd also like to know whether native postscript import is a feature scheduled for a future OOo release, and whether there is a corresponding OOo issue that I could support with my vote.
I doubt you'll ever see this capability in OpenOffice or Microsoft Office or any other non-Adobe word processor. To import means to convert to a format editable by the application you're importing into, and Adobe holds tight reins over licenses to edit PDF and other PS formats... rightfully so. The ability to edit them is how Adobe continues to earn profits on its proprietary formats. Why would they give that away?
Let me clarify. It is not important for me to have a conversion "to a format editable by the application you're importing into" (i.e. by OOo). But some months ago, when I was still using MS Word, whenever I imported an NCL-produced EPS into MS Word, I got the impression that during import the EPS was converted into a (MS Word-internal) graphics format that still maintained its vector data structure. This means the imported graphics were still scalable without quality loss thanks to the vector format. This scalability is what I liked so much about the MS Word EPS import.
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: postscript import (PS, EPS, PDF): EPS fails

Post by foxcole »

letmo wrote:But some months ago, when I was still using MS Word, whenever I imported an NCL-produced EPS into MS Word, I got the impression that during import the EPS was converted into a (MS Word-internal) graphics format that still maintained its vector data structure. This means the imported graphics were still scalable without quality loss thanks to the vector format. This scalability is what I liked so much about the MS Word EPS import.
That's not quite true.

What happens with the EPS format is that the creator program may generate a preview image in either TIF or WMF format. This preview image is what you saw in the Word document, and its quality depends entirely on the quality assigned at file creation (low, medium, or high). It's actually this preview image that you're resizing when you work with the image in Word. Neither TIF nor WMF are vector graphic formats.

Also, if you're not printing the file to a Postscript printer, it's this preview image that prints, not the EPS vector graphic. EPS will only print on a Postscript printer... this is why you see only the preview image onscreen. Your display monitor is not a Postscript device, so it can't read the EPS code to render the graphic. If there's no preview image in the EPS file, all you see is a [mostly] blank box. (At least, that's what should happen.) The image, however, will print correctly... if, that is, you're using a Postscript printer.

I avoid EPS graphics because they're not useful in a word processor, and are completely meaningless in a non-Postscript environment.

There is something wrong with the file format on the EPS file; I can't insert it at all in either portable OOo 2.1 or local install OOo 2.3, in either Writer or Draw---I get an error message that the file is an unknown graphic format. Looking at the file in Hexplorer, I see it's an Adobe 2.0 version file. I wonder whether that version is too recent. Maybe if the file were made compatible with older versions, you might be able to see the preview image in Writer.

Regardless, I might recommend you try other file formats... although I'm not sure of your printing capabilities and needs. I hope this at least helped.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Re: postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

foxcole wrote:What happens with the EPS format is that the creator program may generate a preview image in either TIF or WMF format. This preview image is what you see in the Word document, and its quality depends entirely on the quality assigned at file creation (low, medium, or high). It's actually this preview image that you're resizing when you work with the image in Word. Neither TIF nor WMF are vector graphic formats.
Files like the one I posted do not contain this kind of preview. The situation you describe is not the problem I encounter. (WMF is a vector format.)
foxcole wrote:I avoid EPS graphics because they're not useful in a word processor, and are completely meaningless in a non-Postscript environment.
[...]
Regardless, I might recommend you try other file formats... although I'm not sure of your printing capabilities and needs. I hope this at least helped.
Unfortunately I do not have much choice. My job is to produce and analyse scientific data in NetCDF format, and IMHO the two best freeware tools that can handle this format are Ferret (only .ps output) and NCL (.ps, .pdf and .eps output). I can't change their output, and I can't afford Matlab, IDL, AVS licenses either...
So I produce my data and graphics in the Linux world and I produce my scientific output in Linux or Windows using LyX (LaTeX) for articles and OOo for cooperation and presentations. For the latter I need to find a way to bridge the gap between these worlds.
foxcole wrote:There is something wrong with the file format on the EPS file; I can't insert it at all in either portable OOo 2.1 or local install OOo 2.3, in either Writer or Draw---I get an error message that the file is an unknown graphic format. Looking at the file in Hexplorer, I see it's an Adobe 2.0 version file. I wonder whether that version is too recent. Maybe if the file were made compatible with older versions, you might be able to see the preview image in Writer.
Thanks for having a look anyway. If only I could import it into Draw and from there to Impress or Writer I'd be happy for the time being! If you - or some reader of this post - could point me to the source of format mismatch then I could try to approach the NCL developers over this issue. Maybe they know how to tweak the file, NCL or OOo...
This is precisely the format I could successfully import into MS Office without format mismatch using an import method that is briefly introduced here: http://en.wikipedia.org/wiki/Encapsulat ... d_previews.
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

Your file works for me if I first run it through "eps2eps", which is part of Ghostscript. This "normalizes" some aspects of the EPS file and allows OOo to use it properly. It does not add a preview, but newer OOo releases (>=2.2 I think) will add one automatically if Ghostscript is installed. There are utilities that can add a preview as well--that gives you complete control over the quality of the preview.
AOO4/LO5 • Linux • Fedora 23
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: postscript import (PS, EPS, PDF): EPS fails

Post by foxcole »

letmo wrote:Files like the one I posted do not contain this kind of preview. The situation you describe is not the problem I encounter.
What I described was the nature of EPS files, which nothing can change and nothing has changed since EPS was developed. I've no idea what you mean by that not being the problem.

If you're able to view the image on your monitor, regardless of what program you're using, then it has a preview file... even if it's an automatically generated one. There is simply no other way for your monitor to be able to display the graphic.
letmo wrote:(WMF is a vector format.)
You're quite right about that. I'm accustomed to its working with raster graphics, which I use almost exclusively, so my mind pretty much dropped the vector aspect. I had no reason to remember it, I suppose.
letmo wrote:Unfortunately I do not have much choice. My job is to produce and analyse scientific data in NetCDF format, and IMHO the two best freeware tools that can handle this format are Ferret (only .ps output) and NCL (.ps, .pdf and .eps output). I can't change their output, and I can't afford Matlab, IDL, AVS licenses either...
So I produce my data and graphics in the Linux world and I produce my scientific output in Linux or Windows using LyX (LaTeX) for articles and OOo for cooperation and presentations. For the latter I need to find a way to bridge the gap between these worlds.
You have my sympathies! It appears you're stuck with making sure the EPS previews are high-quality WMF format.
foxcole wrote:There is something wrong with the file format on the EPS file; I can't insert it at all in either portable OOo 2.1 or local install OOo 2.3, in either Writer or Draw---I get an error message that the file is an unknown graphic format. Looking at the file in Hexplorer, I see it's an Adobe 2.0 version file. I wonder whether that version is too recent. Maybe if the file were made compatible with older versions, you might be able to see the preview image in Writer.
That bit I wrote about the 2.0 version isn't right. I found another EPS on my computer that's version 3.0 and doesn't receive that error, so there's just something in the construction of the EPS file that doesn't pass the weak EPS filters in OOo.

Ghostscript has been used in the past by other OOo users to "repair" EPS files. That might help in this case... it would add a step to your process but at least you could still use your process.

EDIT: I see acknak has already posted that suggestion while I was writing my reply. That makes it doubly worth trying, because acknak knows his stuff.
letmo wrote:If only I could import it into Draw and from there to Impress or Writer
I'm pretty sure Draw uses the same EPS file filter as Writer and Impress, so I'm not sure using Draw would make much of a difference. :-/
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Re: postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

foxcole wrote: You have my sympathies! It appears you're stuck with making sure the EPS previews are high-quality WMF format.
Thank you, that is my point. At the end of the day I "just" need decent looking previews e.g. for presentations. (I have no intention of modifying the EPS source itself within OOo, and I understand this would not be possible anyway.)
foxcole wrote:
foxcole wrote:There is something wrong with the file format on the EPS file; I can't insert it at all in either portable OOo 2.1 or local install OOo 2.3, in either Writer or Draw---I get an error message that the file is an unknown graphic format. Looking at the file in Hexplorer, I see it's an Adobe 2.0 version file. I wonder whether that version is too recent. Maybe if the file were made compatible with older versions, you might be able to see the preview image in Writer.
That bit I wrote about the 2.0 version isn't right. I found another EPS on my computer that's version 3.0 and doesn't receive that error, so there's just something in the construction of the EPS file that doesn't pass the weak EPS filters in OOo.
Ghostscript has been used in the past by other OOo users to "repair" EPS files. That might help in this case... it would add a step to your process but at least you could still use your process.
acknak wrote:Your file works for me if I first run it through "eps2eps", which is part of Ghostscript. This "normalizes" some aspects of the EPS file and allows OOo to use it properly.
Thank you both for these suggestions. It works! I did (a) "eps2eps" on openSuse with its Ghostscript 8.15 and (b) "epswrite" on Win XP from GSview 4.9 with its Ghostscript 8.61 and the result for both is same: The original %!PS-Adobe-2.0 EPSF-2.0 is converted into %!PS-Adobe-3.0 EPSF-3.0. It seems that NCL produces an older EPS file format (2.0) that is not recognized by OOo. The converted 3.0 Linux file version (a) is availale at http://www.mediafire.com/?9mcmzo9eywz.
foxcole wrote:
letmo wrote:If only I could import it into Draw and from there to Impress or Writer
I'm pretty sure Draw uses the same EPS file filter as Writer and Impress, so I'm not sure using Draw would make much of a difference. :-/
Yes, I agree with you; so far I found they all behave the same regarding my old and new EPS files.
acknak wrote:It does not add a preview, but newer OOo releases (>=2.2 I think) will add one automatically if Ghostscript is installed. There are utilities that can add a preview as well--that gives you complete control over the quality of the preview.
Here I observed a different behaviour of my OOo 2.3.1 between openSuse 10.2 and Win XP. My OOo on openSuse generates a preview, while on Win XP it doesn't (instead it draws a red frame with three text lines on Creator, Date and Language Level). However, Ghostscript is installed on both systems. Therefore, based on your comment, I guess that OOo may not be aware that Ghostscript is available on my Win XP. If possible, could you please let me know how to proceed?
The utilities you mentioned: are they available as OOo plugins, makros or the like on Linux or Windows?
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

... I guess that OOo may not be aware that Ghostscript is available on my Win XP. If possible, could you please let me know how to proceed?
Sorry, no. I don't know anything about how OOo generates the preview, or what the requirements are (other than Ghostscript)--especially on Windows.

Here is the issue that tracked the status of the feature: Issue 9290. From that (assuming I have the right issue), it seems that both Ghostscript (GS) and imageMagick (IM) are required, and that WIndows is supported if those packages are installed. It looks like OOo runs "convert" from IM, which calls GS to generate the preview.

If installing IM doesn't help, you may want to poke around (Google, and/or search OO.org) and see if you can find any clear documentation on how to make this work. If you can't find any, I would suggest that you add a comment on that issue saying that it doesn't work for you, and requesting some specific documentation on what is required to make the feature work.
The utilities you mentioned: are they available as OOo plugins, makros or the like on Linux or Windows?
Both IM and GS are external programs, not part of, or integrated with, OOo in any way. OOo merely runs the program(s) if they are available. You could just as well run it yourself on the EPS file before you insert it in your document; in fact, that would be the workaround if you can't get OOo to generate the preview for you. You can just bundle up eps2eps and convert in a little script and run that on your EPS files created by NCL, to prepare them for use in OOo.

The preview generation utility I've used is called "epstool", another external program, and is available from various places around the 'Net--Google should find it. I'm fairly sure I've seen binaries for both Linux and Windows.
AOO4/LO5 • Linux • Fedora 23
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Re: postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

Sorry for the long silence. Now I have finally contacted the developers of the NCL software that produces the %!PS-Adobe-2.0 EPSF-2.0 EPS format. Here's their reply:
> apparently Openoffice.org is unable to directly import NCL's EPS
> output (header starts with "%!PS-Adobe-2.0 EPSF-2.0") whereas it is
> able to import the newer EPS format (header starts with "%!PS-
> Adobe-3.0 EPSF-3.0"). I refer to "direct import" as "without the
> use of an external converter"; I'd be happy to avoid such an
> additional postprocessing step.
>
> Is there a way to tell NCL to produce 3.0 EPS files, or any chance
> NCL's EPS output format could be updated in a future NCL release?

What NCL produces is in fact PostScript Level 2. Level 3 should be backward
compatible with level 2. Some printers will not yet accept Level 3 and that is why
we hesitate to flag our Postscript files at Level 3. It is my opinion that any printer
or application that honors Level 3 should accept Level 2.
The question now goes back to OOo: is there any chance that import of EPS of PostScript Level 2 will be supported in a future release?
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: postscript import (PS, EPS, PDF): EPS fails

Post by foxcole »

letmo wrote:Sorry for the long silence. Now I have finally contacted the developers of the NCL software that produces the %!PS-Adobe-2.0 EPSF-2.0 EPS format. Here's their reply:
What NCL produces is in fact PostScript Level 2. Level 3 should be backward
compatible with level 2. Some printers will not yet accept Level 3 and that is why
we hesitate to flag our Postscript files at Level 3. It is my opinion that any printer
or application that honors Level 3 should accept Level 2.
The question now goes back to OOo: is there any chance that import of EPS of PostScript Level 2 will be supported in a future release?
Please understand this is a user-to-user forum, so we have no more control over what is considered for future releases than any other user does. You might have more luck asking that question on the OOo wiki or posting it as an issue (if it has not already been) in the IssueTracker. You'll need to register and log in to post but not to search.

My own guess is that PostScript 2 will not be supported in the future. Just getting that request put in and prioritized and scheduled would take so long that by the time the request comes up, that technology will be even longer outdated than it already is. You'll rarely (if ever) get any developers of any software in the world to retro-engineer their products to support old versions of any software other than their own.

Technology moves forward, which is both good and bad at the same time. It means we enjoy ever-increasing functionality but also must constantly update our equipment and our own software (if we're developers) to keep up with it. Therefore, that reply you received is patently ridiculous and is the kind of attitude that buries software vendors. It's a laughably stereotypical example of the "it's not our problem" reply that users have come to expect.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

I'm really not an expert on the various Postscript/EPS levels, but my gut feeling is that you're barking up the wrong tree here. I don't think the problem has anything at all to do with the PS level being 2 or 3.

Is it the message that OOo gives you when you try to insert the graphic that leads you to this: "Unknown Graphic Format"?

If so, you should know that OpenOffice has about the worst error handling of any software I have ever used. The only good thing I can say about it is that it doesn't crash when it encounters an error. But the messages you get seldom give you any specific, useful information. Further, what they do tell you is often misleading or outright wrong. So always take an error message from OOo with a big grain of salt.

Here's some little experiments I did with your file:
File      Created by                Content Header  Insert > Picture
--------  ------------------------  ------- ------  ----------------
val.eps   (original)                 EPSF-2 EPSF-2    FAIL
val3.eps  eps2eps val.eps val3.eps    2+3     3       OK
val2.eps  edit header of val3         2+3     2       OK
val1.eps  eps2eps                     1       3       OK
           -dLanguageLevel=1
           val.eps val1.eps
val12.eps edit header of val1         1       2       OK
val3x.eps edit header of val          2       3       FAIL
It's a little hard to follow there, but you can see that no matter what the header says, the original file content always fails (top+bottom rows). OTOH, no matter what the header says, or whether the content is level 2+3 or level 1, the file content after processing by eps2eps always works (middle rows).

My conclusion from this is that it does not matter what Postscript level is used, or what the PS header says. What matters is the content of the file.

I don't know what features OOo is looking for in the file to conclude that the "graphic format is unknown" but I am convinced that it's not the PS level.

I'm not sure what your best next step is, but I don't think waiting for OOo to change is going to get you where you want to go.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

Ok, here's the real kicker.

The result of eps2eps on your file is not so great. So, I took your file and ran it through epstool, which adds a preview image to an EPS file.

The result of that was far better: Writer would insert it, the preview was better, and Writer's performance was far better.

Looking at the EPS output from epstool, the only change it had made to the Postscript code was to move the bounding box statement from the end up to the top of the file. And in fact, if I do the same to your original file manually using a text editor, OOo will insert the file just fine.

So the Postscript level has nothing to do with whether OOo will handle the file, and it looks like epstool is the better EPS-file-fixer for you.
AOO4/LO5 • Linux • Fedora 23
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: postscript import (PS, EPS, PDF): EPS fails

Post by foxcole »

Wow, acknak -- great job, as usual! I'm bookmarking this one for future reference.

(It might be interestng, letmo, to hear NCL's response if you were to send them ackhak's findings.)
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Re: postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

Thanks a lot for your feedback and especially for your series of tests on my NCL-produced EPS file, acknak. Thanks to your help the core of my problem is finally identified.

With the command "epstool --copy val.eps val_new.eps" I could reproduce your results: on importing val.eps Writer produces "Unknown graphic format", whereas importing val_new.eps works fine. The only difference between both files is the position of the bounding box statement. My hypothesis is that this is because OOo is not able to handle the "%%BoundingBox: (atend)" statement in val.eps.

Concerning the bounding box, http://www.tug.org/docs/html/dvips/dvips_28.htm tells
If the file contains [...] a line like
%%BoundingBox: (atend)
the file is still probably Encapsulated PostScript, but the bounding box is given at the end of the file. [...] (The bounding box is given in this way when the program that generated the PostScript couldn't know the size in advance, or was too lazy to compute it.)
Thus, if it is possible for NCL to calculate the bounding box size in advance, the problem could be solved on their side. If this is not possible, then running epstool would be a workaround solution for me. A general solution would be to enable OOo to handle the "%%BoundingBox: (atend)" statement. A search for "atend" in Issue Tracker shows that this problem has been raised in Issue 9357 and is currently handled as Issue 28260 with priority P4.

As you suggested, foxcole, I have emailed the results along with a link to our thread to the NCL developer team. I will post their reply here.
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

Good work! Thanks for reporting that here; This seems like the right way forward.

OOo's support for EPS is not very robust, unfortunately. It seems to require lots of extra help. There have been some improvements though, so hopefully some of these things will be addressed.
AOO4/LO5 • Linux • Fedora 23
letmo
Posts: 7
Joined: Wed Dec 26, 2007 11:33 am

Re: postscript import (PS, EPS, PDF): EPS fails

Post by letmo »

Well, here is the reply from a member of the NCL developer team:
Putting the bounding box information at the beginning of the file is something
that we have on our list, but it requires that the information needs to be gathered
during the file creation and then inserted at the beginning when the picture
is terminated. Since we create the file during execution instead of saving it
in a buffer and writing it at the end, we would have to read the file that has
been created and then re-write it with the bounding box information inserted.
Since the ps2ps and ps2epsi tools are readily available, we have not assigned
a high priority to this task. My recommendation would be to write a normal
Postscript file and then run that through ps2ps. The version of ps2ps that I
have (which is two years old) also changes the Postscript level from 2 to 3.

If this becomes a big issue for people, then we will reconsider its priority.
It seems that at least three workarounds (ps2ps, ps2epsi, epstool) are working, which is one of the reasons why currently neither OOo nor NCL assign a high priority to this issue.

My thanks go to all involved for their help in identifying and solving this issue. I continue to wait for a better solution but I am happy to know rather easy workarounds for the meantime.
OOo 2.4.0 / openSuse 10.2 & Win XP Pro SP2
xxhc
Posts: 1
Joined: Sat Jul 05, 2008 6:34 pm

Re: postscript import (PS, EPS, PDF): EPS fails

Post by xxhc »

NLC wrote
If this becomes a big issue for people, then we will reconsider its priority.
letmo wrote
It seems that at least three workarounds (ps2ps, ps2epsi, epstool) are working, which is one of the reasons why currently neither OOo nor NCL assign a high priority to this issue.
ok, here is my voice: I think it would be great to reconsider priority status of these issues.

The various issues submitted on this bug are as old as 4 years. As for me, I am frequently switching between LaTeX and OOo and dont feel like converting eps files too often by hand.

Thank you for the workarounds though!
OOo 2.4.X on Ms Windows XP + Ubuntu Linux 7.10
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: postscript import (PS, EPS, PDF): EPS fails

Post by foxcole »

xxhc wrote:ok, here is my voice: I think it would be great to reconsider priority status of these issues.
This is a user-to-user forum. To make your voice heard, you need to go vote for and/or add comments to the issues you found in the issue tracker. This increases the issue's visibility because it helps increase the issue's 'popularity' ranking, one of many aspects that figure into an issue's priority assignment.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
markush
Posts: 6
Joined: Tue Oct 07, 2008 9:18 pm

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by markush »

I saw the issue is closed. Is it possible to reopen the issue?
OOo 2.4.X on Ubuntu 8.x
User avatar
Bhikkhu Pesala
Posts: 1253
Joined: Mon Oct 08, 2007 1:27 am

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by Bhikkhu Pesala »

Issue 28760 is not closed.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
markush
Posts: 6
Joined: Tue Oct 07, 2008 9:18 pm

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by markush »

Thank you, I overlooked this issue. But it is only about inserting the eps preview picture, which means that it is not possible to resize an eps graphic without quality loss. Eps is kind of a standard format in mathematics and physics, so I am sure that a lot of people would like to see open office to be able to treat eps files as vector graphics.
OOo 2.4.X on Ubuntu 8.x
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

That issue is about a specific problem that prevents OOo from understanding certain EPS files. There are workarounds for that specific problem mentioned above in this thread.

There is no general problem with inserting or resizing EPS files in OOo.

If you have a problem that's still unresolved, please start a new thread, and explain exactly what your problem is. If you have a particular EPS file that OOo doesn't like, it would be helpful to attach it to your message.
AOO4/LO5 • Linux • Fedora 23
markush
Posts: 6
Joined: Tue Oct 07, 2008 9:18 pm

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by markush »

The problem is, that afaik open office cannot treat eps as a vector graphic. You can just insert (and rescale) a preview pixel picture of the original vector graphic. And that is a serious shortcoming. Open office should be able to render eps as a vector graphic.

Please correct me if I'm wrong...
OOo 2.4.X on Ubuntu 8.x
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

That is not really correct. OOo supports EPS files as a vector format, including scaling. However, there are some important limitations.

Under circumstances where the output can't handle the vector information, OOo will substitute the preview image. E.g. the screen display always shows the preview image, as does PDF output. Printed output, or "Print to File" output (Postscript), will include the vector information at full resolution.

At least, that's the case on Unix/Linux (&Mac?) where the printing system handles Postscript well. I'm not sure about Windows, where Postscript support is not always available.

If you're finding that you're getting the preview image in your output, you may be able to take a different route and get better results. You can either convert the EPS to a different format, or use "print to file" to get Postscript output and then print that, or convert it to PDF.
AOO4/LO5 • Linux • Fedora 23
markush
Posts: 6
Joined: Tue Oct 07, 2008 9:18 pm

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by markush »

Good to know. I am mainly interested in screen display (making presentations with impress). In which format should I convert my eps files?
OOo 2.4.X on Ubuntu 8.x
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by acknak »

Beats me. I really don't know what EPS features OOo requires--well, I guess we know about the "(atend)" problem.

I use the command line utilities eps2eps (comes with ghostscript) and epstool (Google for it) are adequate to do whatever conversions I've needed. Sometimes it's easier to simply convert the EPS to an image. I use "convert" for that (part of Image Magick) and it's easy to get a nice image at any resolution--more than adequate for screen display.
AOO4/LO5 • Linux • Fedora 23
shardalule
Posts: 83
Joined: Tue Sep 15, 2009 9:44 am

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by shardalule »

For me PS is also not opening in Openoffice calc or word.please can people help me out.How to export PS Script in OpenOffice by using which tool .
OpenOffice3.0.1 Windows Xp Proffessional
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Postscript import (PS, EPS, PDF): EPS fails

Post by Hagar Delest »

Have you read the first reply of this thread???

.ps file cannot be imported in word processors.

And please stop multi-posting.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply