Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong size for EPS documents #15

Closed
eseifert opened this issue Mar 30, 2015 · 7 comments
Closed

Wrong size for EPS documents #15

eseifert opened this issue Mar 30, 2015 · 7 comments
Milestone

Comments

@eseifert
Copy link
Owner

EPS appears to be fixed to a certain document size rather than using the measurements requested.

The result is cropping or huge whitespace.

Attached is an EPS and SVG, both generated with identical settings. Only difference being class used.

Imported from trac ticket #9, created by Detritus on 11-26-2010 at 18:49, last modified: 11-30-2010 at 17:33

@eseifert eseifert added this to the 0.8 Release milestone Mar 30, 2015
@eseifert
Copy link
Owner Author

The bounding box information which is used to determine the size of EPS documents uses wrong values: It uses x, y, width, height instead of xLowerLeft, yLowerLeft, xUpperRight, yUpperRight.

This bug will be corrected as soon as possible.

Trac comment by eseifert on 11-29-2010 at 01:30

@eseifert
Copy link
Owner Author

r38 fixes the problem by using x, y, x + w, y + h instead of x, y, w, h.

Trac comment by eseifert on 11-29-2010 at 20:14

@eseifert
Copy link
Owner Author

This issue still appears to be outstanding in r41.
I have attached graph.eps which highlights the issue.

Viewer used: Ghostscript.

Trac comment by Detritus on 11-30-2010 at 12:19

@eseifert
Copy link
Owner Author

As far i can tell the size for EPS files is written correctly. I have checked the bounding box with Ghostscript 8.71:

gs -sDEVICE=bbox -dNOPAUSE -dBATCH -dEPSCrop graph.eps

Be aware that the current version of VectorGraphics2D does not the scale the painted objects to fit on the page. So, at the moment you have to take care that the coordinates used for painting are within the document bounds (1 pixel = 1 mm), otherwise the EPS will be cropped to the page size.

A solution to the problem could be to scale all painting operations to fit on the page (e.g. g2d.scale(0.5, 0.5)). Another solutions is to use the -dEPSCrop or the -dEPSFitPage option when displaying EPS files with Ghostscript.

I will leave this as reopened and will further investigate this issue. It's not a blocker anymore, however. More information on your use case can help me to find a better solution. Useful information could be: How would you like to use the EPS file? Which applications are involved?

Trac comment by eseifert on 11-30-2010 at 15:56

@eseifert
Copy link
Owner Author

I'm not greatly knowledgeable of the EPS format, is the EPS limited to fixed document sizes, e.g. A4? Is that the "cropping" effect which is occurring? Or is this a limit in Ghostscript?

My interest in EPS is to allow data to be exported into a format that is friendly to LaTeX and to printers.

At the moment I have no idea (untested) how LaTeX will handle these "cropped" EPS files.

Trac comment by Detritus on 11-30-2010 at 16:11

@eseifert
Copy link
Owner Author

EPS files define a bounding box which can then be used to place them on a page. The page size is defined by the application (e.g. Ghostview).

Usually, you will specify how large the graphics will be on the page. If you do, there won't be cropping like you experienced it with Ghostview. I successfully tested this with a small LaTeX document that includes the graph.eps EPS file you attached earlier on (see attachment).

I will close this ticket as the issue of proper scaling (dpi) will be solved in a later version (see ticket #10).

Trac comment by eseifert on 11-30-2010 at 17:22

@eseifert
Copy link
Owner Author

Excellent, nice to know it's workable in it's current form.
Thanks again!

Trac comment by Detritus on 11-30-2010 at 17:33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant