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

pstops mishandles eating %%BeginFeature/%%EndFeature blocks #2306

Closed
michaelrsweet opened this issue Mar 22, 2007 · 4 comments
Closed

pstops mishandles eating %%BeginFeature/%%EndFeature blocks #2306

michaelrsweet opened this issue Mar 22, 2007 · 4 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2.8
CUPS.org User: markd

When n-uping postscript that includes %%BeginFeature/%%EndFeature blocks, pstops fails to detect the end of the block and eats lines up to the end of the %%EndPageSetup section.

eg. A postscript file that includes the following:

%%BeginPageSetup
%
[{
%%BeginFeature: *InputSlot Tray_2

<</ManualFeed false /MediaPosition 0>> setpagedevice

%%EndFeature
} stopped cleartomark
[{
%%BeginFeature: *PageSize Letter

<</DeferredMediaSelection true /PageSize [612 792] /ImagingBBox null /MediaC

lass null >> setpagedevice
%%EndFeature
} stopped cleartomark
%%EndPageSetup

as generated by openoffice, when run through "pstops number-up=2" produces:

%%BeginPageSetup
userdict/ESPsave save put
18.0 36.0 translate
0.0 720.0 translate -90 rotate
0.0 55.1 translate 0.588 0.588 scale
0 0 612 792 ESPrc
%
[{
%%EndPageSetup

because it didn't detect the %%EndFeature.

The attached file has the fix for pstops.c

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: h.blischke

Though your patch will fix the detection of the end of a feature block, things like n-up printing probably will not succeed, as OpenOffice creates PS jobs tha pages of which are not independent of each other. The stuff you see within the page setup of the first page should be moved to the end of the setup section (just before the %%EndSetup comment line).

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: markd

I can't say if in general OpenOffice postscript is not page independent but certainly our 2-up'ing of test documents worked happily, whereas without the patch you get postscript errors (from having the [{ but not the cleartomark)

cheers
mark

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"patch-ae":

$NetBSD$

--- filter/pstops.c.orig 2007-03-09 02:40:01.000000000 +1300
+++ filter/pstops.c
@@ -1537,7 +1537,7 @@ copy_page(cups_file_t fp, / I - File
if (doc->number_up > 1 || doc->fitplot)
continue;
}

  •  else if (!strncmp(line, "%%EndFeature:", 13))
    
  •  else if (!strncmp(line, "%%EndFeature", 12))
    
    {
    feature = 0;

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

No branches or pull requests

1 participant