[Xcircuit-dev] RE: XCircuit
R. Timothy Edwards
tim at stravinsky.jhuapl.edu
Mon Feb 16 14:13:42 PST 2004
Dear Svenn,
> I would like to see the PageBoundingBox for a multi-page project become the
> real bounding box that a program like gv can properly interpret. Since there
> are no tools for extracting pages from a postscript file depending on the
> %%Page command, I wrote one myself in tcl that strip a project apart into
> separate EPS files. To me it is very important that the page bounding box is
> a valid box because otherwise I will waste lots of space on the white border.
> I have to use epstool to recalculate the bounding boxes. I modified 3.1.37 by
> hand and recompiled to get what I wanted. Problem was that in 3.1.38 the EPS
> code changed again. 3.1.37 obeyed the pageboundingbox when forcing xcircuit
> to save the page as embedded postscript even if it was a multipage
> postscript. If I didn't set the flag, it would give me a a4 size page with a
> tiny useless symbol in the middle, and I would have to run epstool to get it
> all right.
I am, you know, an open-source developer, and as such, I usually try
to incorporate source code sent to me, as long as it doesn't appear to
break anything. If you send me the Tcl code made to deal with the 3.1.37
output to get the bounding box information to work for you, I'll see what
I can do about incorporating the same into the 3.1.38 source code, so you
don't need to run the script on it.
My problems came from using ghostview and latex. They started
after I changed the way xcircuit outputs multiple pages. XCircuit
used to look at what definitions were needed on a page, and throw them
into the output between pages. This tended to give postscript previewers
fits, and didn't conform to DSC (document structuring conventions)
(ghostview, for instance, handled it fairly well, but couldn't flip
pages in reverse order; if you wanted to go back, you had to force it
to re-read the document from the top).
However, after making those changes, I started working on the bounding
boxes. I ran into various conflicts between what various programs seemed
to think the bounding boxes were supposed to be there for, and they didn't
always appear to be compatible. What I ended up with works for the
several applications that I use xcircuit in: 1) writing an encapsulated
page and reading it into a LaTeX document (I had the worst problems with
this---possibly the "epsfig" implementation in LaTeX is not quite right),
2) viewing encapsulated, full-page, and multi-page xcircuit output in
ghostview/ghostscript, adobe acrobat (after using ps2pdf), and printing
directly to the printer. Knowing whether xcircuit works or breaks in
other contexts requires feedback from the users.
Your specific problem may be due to the fact that I generally force
multi-page documents to be non-encapsulated. I would guess that
forcing encapsulated mode on a multi-page document results in
undefined behavior, which is therefore likely to break any time I
mess with that code. If I can figure out from your Tcl script what
the output should look like for this case, then I can make sure that
is what xcircuit always produces for output.
> Since there are no tools for extracting pages from a postscript file
> depending on the %%Page command . . .
Are you aware of "psselect"?---
"Psselect selects pages from a PostScript document, creating a new
PostScript file. The input PostScript file should follow the Adobe Docu-
ment Structuring Conventions.
"The -ppages option specifies the pages which are to be selected. Pages is
a comma separated list of page ranges, each of which may be a page number,
or a page range of the form first-last. If first is omitted, the first
page is assumed, and if last is omitted, the last page is assumed."
Regards,
Tim
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Xcircuit-dev mailing list
Xcircuit-dev at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xcircuit-dev
More information about the Xcircuit-dev
mailing list