[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Producing postscript for custom paper size (9x12" manuscript paper)?
From: |
John Hawkinson |
Subject: |
Re: Producing postscript for custom paper size (9x12" manuscript paper)? |
Date: |
Mon, 3 Apr 2006 16:45:09 -0400 |
User-agent: |
Mutt/1.5.6i |
I <address@hidden> wrote on Mon, 3 Apr 2006 at 13:54:27 -0400 in
<address@hidden>:
> I wasn't very happy forcing /ManualFeed true, but without that, my
> printer produced a configuration error because it could not find the
> right paper size. Setting various keys in the /Policies dictionary
> seem like they ought to fix this, but I wasn't really able to get it
> working right. Looking at the HP8000 series PPD file (I can't seem to
> find a postscript reference manual for it...), it looks like an
> alternative would be to set /DeferredMediaSelection true, but this
> looks like an HP-specific extension (though it seems to work ok...).
For the record, I was looking at the 2nd edition of the PLRM instead
of the 3rd edition. /DeferredMediaSelection is indeed standardized.
Here's a better version of my framework-ps.scm patch).
address@hidden
John Hawkinson
--- framework-ps.scm 2006/04/03 04:16:31 1.1
+++ framework-ps.scm 2006/04/03 20:40:49 1.4
@@ -390,6 +390,57 @@
(pfas (map font-loader font-names)))
pfas))
+
+ ;; XXX: jhawk local patch to add support for manuscript paper. We
+ ;; need to tell the printer (or PDF writer) about the paper size
+ ;; so the right kind of page rotation happens, etc.
+ (if (equal? (ly:output-def-lookup paper 'papersizename) "manuscript")
+ ;; The desired behavior is that the printer will print on
+ ;; 9x12" ("manuscript") paper if that paper is loaded into
+ ;; a cartridge, otherwise it will pull that paper from the
+ ;; manual feed tray, perhaps prompting the user to insert it.
+ ;;
+ ;; PostScript Level 3 supports /DeferredMediaSelection which
+ ;; allows the output device to decide on the media selection
+ ;; after the postscript interpreter has finished executing. In
+ ;; certain printers, like the HP 8000s, this is necessary to
+ ;; allow operator intervention to insert a necessary paper size.
+ ;;
+ ;; We assume here that this is the correct choice for any L3
+ ;; printer. But Level 2 printers are more limited. Instead, we
+ ;; simply set /ManualFeed true. Is is possible that some
+ ;; L2 printers would prefer to be told to implement PolicyNotFound
+ ;; "code 2," which means "Interact with a human operator or print
+ ;; manager to determine what to do." If you have an L2 printer
+ ;; and would like to experiment with that, try changing
+ ;; /ManualFeed true
+ ;; to
+ ;; /Policies << /PageSize 2 /PolicyNotFound 2 >>
+ ;; and let us know how it works.
+ ;;
+ ;; Really, we should get the page dimensions by multiplying
+ ;; the 'vsize and 'hsize values by the output-scale and multiplying
+ ;; that by the /lily-output-units. It should then be reasonable to
+ ;; remove the conditionalization on manuscript paper and always
+ ;; output the dimensions (except for level 2 postscript printers).
+ (display "%%BeginFeature: *PageSize Manuscript
+<<
+ % Determine LanguageLevel of implementation
+ /languagelevel where
+ { pop languagelevel } % Execute languagelevel if it exists
+ { 1 } % Otherwise assume 1
+ ifelse
+ 3 lt
+ { % If <3, set ManualFeed.
+ /ManualFeed true }
+ { % If L3 or better, enable DeferredMediaSelection. This is certainly
+ % right for HP printers, and quite possibly for others.
+ /DeferredMediaSelection true }
+ ifelse
+/PageSize [ 648 864 ] /ImagingBBox null >> setpagedevice
+%%EndFeature: *PageSize Manuscript
+" port))
+
(if load-fonts?
(for-each
(lambda (f)
Re: Producing postscript for custom paper size (9x12" manuscript paper)?, Rick Hansen (aka RickH), 2006/04/03
Re: Producing postscript for custom paper size (9x12" manuscript paper)?, Rick Hansen (aka RickH), 2006/04/10