static int N_pages, Cur_page;
/* static point Pages; */
static box PB;
+static box DBB;
static int onetime = TRUE;
static int isLatin1;
static char setupLatin1;
fprintf(Output_file, "%%%%For: %s\n", user);
fprintf(Output_file, "%%%%Title: %s\n", g->name);
fprintf(Output_file, "%%%%Pages: (atend)\n");
+ if (Show_boxes == NULL)
+ fprintf(Output_file, "%%%%BoundingBox: (atend)\n");
+ fprintf(Output_file, "%%%%EndComments\nsave\n");
}
/* remainder is emitted by first begin_graph */
{
fprintf(Output_file, "%%%%Trailer\n");
fprintf(Output_file, "%%%%Pages: %d\n", Cur_page);
+ if (Show_boxes == NULL)
+ fprintf(Output_file, "%%%%BoundingBox: %d %d %d %d\n",
+ DBB.LL.x, DBB.LL.y, DBB.UR.x, DBB.UR.y);
fprintf(Output_file, "end\nrestore\n");
fprintf(Output_file, "%%%%EOF\n");
setupLatin1 = FALSE;
PB = bb;
if (onetime) {
- if (Show_boxes == NULL)
- fprintf(Output_file, "%%%%BoundingBox: %d %d %d %d\n",
- PB.LL.x, PB.LL.y, PB.UR.x, PB.UR.y);
- fprintf(Output_file, "%%%%EndComments\nsave\n");
cat_libfile(Output_file, U_lib, ps_txt);
epsf_define(Output_file);
if (Show_boxes) {
ps_begin_page(graph_t * g, point page, double scale, int rot, point offset)
{
point sz;
+ box pbr;
Cur_page++;
sz = sub_points(PB.UR,PB.LL);
fprintf(Output_file, "%%%%Page: %d %d\n", Cur_page, Cur_page);
if (Show_boxes == NULL) {
- if (rot)
- fprintf(Output_file, "%%%%PageBoundingBox: %d %d %d %d\n",
- PB.LL.y, PB.LL.x, PB.UR.y, PB.UR.x);
- else
- fprintf(Output_file, "%%%%PageBoundingBox: %d %d %d %d\n",
- PB.LL.x, PB.LL.y, PB.UR.x, PB.UR.y);
+ if (rot) {
+ pbr.LL.x = PB.LL.y;
+ pbr.LL.y = PB.LL.x;
+ pbr.UR.x = PB.LL.y;
+ pbr.UR.y = PB.LL.x;
+ }
+ else {
+ pbr = PB;
+ }
+ fprintf(Output_file, "%%%%PageBoundingBox: %d %d %d %d\n",
+ pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
+ if (onetime) {
+ DBB = pbr;
+ }
+ else {
+ EXPANDBB(DBB, pbr);
+ }
}
fprintf(Output_file, "%%%%PageOrientation: %s\n",
(rot ? "Landscape" : "Portrait"));