Help with custom page size support for non standard paper

Firstly, we appreciate any support you may be able to provide, we have already thrown considerable effort at this and it has been very time consuming and frustrating.

To support a number of business functions need to print to (non standard) continuous and mulitpart paper on a dot matrix printer. The (test) Mac is a 10.4.11 G4 laptop, the printer is an Oki Microline 520 (9 pin 80 column, IBM Proprinter, Microline or Epson FX personalities with a parallel interface) which has been networked via a HP JetDirext Ex Plus print server. That part appears to be operating correctly.

We have tried a number of drivers / printer personalities with varying levels of success:

ESP / EPSON 9-Pin Series CUPS v1.1 / Epson FX personality
ESP / OKIDATA 9-Pin Series CUPS v1.1 / Oki Microline personality
Ghostscript / epsonc / Epson Dot Matrix Foomatic PPD / Epson FX personality
Ghostscript / ibmpro / IBM ProPrinterII Foomatic PPD / IBM Proprinter personality
Ghostscript / okiibm / Oki Microline IBM compatible 9 pin Foomatic PPD / IBM Proprinter personality

There were no appropriate drivers in Gutenprint (5.2.3 version) The most successful is the okiibm / Oki Microline IBM compatible 9 pin settings, it can print A4 and honors the Printer Features Resolution settings in the print dialogue.

Q1: Should we see anything in the Printer Info / Installable Option, it is always blank ?

The issue is custom page sizes, we can manage / add Custom Pages Sizes via the Page Setup / Paper Size interface and they draw on the screen OK but they do not work at the printer (various issue at the printer such error messages, junk printing and wrong orientation):

Q2: Are we heading in the right direction or is there a better way to handle this ?

Q3: Would 10.5 solve all our problems, are the print drivers any better ?

Q4: Is this the correct way to specify custom page sizes, is this all we need to do ?

Q5: Is so how do we get the driver to respect the size, do we need another filter or something ?

Q6: Is it possible to add (by hand) custom page sizes to the ESP drivers or Foomatic PPD files so they they appear as a "standard" offering in the Page Setup / Paper Size interface ?

Sorry for the long / complicated post and thanks in advance for any advice / assistance.

1.67 GHz G4 laptop, Mac OS X (10.4.11)

Posted on Jun 3, 2009 11:11 PM

Reply
29 replies

Jun 4, 2009 12:18 AM in response to Hetsr

Hello Hestr, and a warm welcome to the forums! 🙂

There's better Printer experts here than me by far, but to start it off...

Q1: Should we see anything in the Printer Info / Installable Option, it is always blank ?


On many drivers it is blank.

Q2: Are we heading in the right direction or is there a better way to handle this ?


I think mostly so.

Q3: Would 10.5 solve all our problems, are the print drivers any better ?


I personally doubt it.

Q4: Is this the correct way to specify custom page sizes, is this all we need to do ?


Normally yes.

they draw on the screen OK but they do not work at the printer (various issue at the printer such error messages, junk printing and wrong orientation):


This is where the problem is.

Q5: Is so how do we get the driver to respect the size, do we need another filter or something ?


Click on the Cpies & Pages in the Print Dialog, look for "Paper Handling", then Scale to size & such.

Also, in the APP's Page Setup, se what settings are there.

Q6: Is it possible to add (by hand) custom page sizes to the ESP drivers or Foomatic PPD files so they they appear as a "standard" offering in the Page Setup / Paper Size interface ?


Most PPDs are plain ASCII, take a look at it.

Jun 4, 2009 3:06 AM in response to BDAqua

BDAqua, thanks for the feedback, your responses were as I suspected.

I tried the Print / Paper Handling / Scale to fit paper size but no joy. If I use a custom paper size in portrait it comes out rotated by 90 degrees, if I use another (identical but rotated) custom paper in landscape it gets an error message.

I have had a look through Word (2004 for Mac Ver 11.5.3) and Printer setup and Print dialogue for an ability to rotate the output but no joy. No other settings spring to view that look like they would have any bearing on proceedings.

Regarding modifying the PPD, I have already looking at the innards of the file and while it is well structured it is still more complex that I really like. If nothing else comes to light it may be my last option to do a bit of brain surgery.

Q1: Have you ever had / heard of any success modifying PPD files ?

Q2: Does CUPS / postscript / ghostscript / PPD support rotation ?

Q3: How does the print dialogue support options like PPD based custom paper size and rotate ?

Thanks Hetsr

Jun 4, 2009 6:18 PM in response to Hetsr

Hetsr wrote:
The issue is custom page sizes, we can manage / add Custom Pages Sizes via the Page Setup / Paper Size interface and they draw on the screen OK but they do not work at the printer (various issue at the printer such error messages, junk printing and wrong orientation):


When you create a custom paper size, are you sure you have the orientation of the sizes correct? Also, make sure that the margins are correct for the printer. From the PPD file from OpenPrinting.org, it appears that the top, right, and left margins are 0.25 in (18 points). The bottom margin should be 0.50 in (36 points).

Q5: Is so how do we get the driver to respect the size, do we need another filter or something ?


You can check the CUPS error_log to make sure that both cgpdftoraster page size and the gs command show that the custom paper size is being honored. I have some simple double-click scripts that can aid you in turning on CUPS debugging and extracting the error_log file. They are on my web space at _ http://webpages.charter.net/mbroughtn/downloads/debugScripts.zip_. I am not in OS X 10.4.x right now, but OS X 10.5.6 is respecting the custom paper size in test prints I did using the driver you specified.

Q6: Is it possible to add (by hand) custom page sizes to the ESP drivers or Foomatic PPD files so they they appear as a "standard" offering in the Page Setup / Paper Size interface ?


This should not be necessary if the CUPS error_log shows that the custom paper size is being honored.

One thing you might want to try is to edit the PPD file to change the filters that the printing system is using. There were recent changes to Foomatic-RIP. A PDF workflow was instituted. You could make the following changes --

Back up the PPD file and then find the lines
<pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">*cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip"
*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"
*cupsFilter: "application/vnd.apple-pdf 25 foomatic-rip"</pre>

EDIT: Had the wrong filter statement in original post. It should have a 0 (zero) rather than 100 after the word postscript.
and change them to the following one line
<pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"</pre>

Delete your existing printer and add a new printer using the amended PPD.

Please let us know if this helps.

Matt

Message was edited by: Matt Broughton

Jun 4, 2009 11:05 PM in response to BDAqua

It was (very) late last night that I was working through this and from memory there were no issues with the Mac side of things, print preview etc all looked good. I didn't think to print to pdf but the preview always looked good, even to the point of clipping text if the Word page / margin settings didn't match the ppd settings.

The issues arose when I sent it to the printer, with custom paper in one orientation the text would come out rotated vertically (on screen it was horizontal on landscape paper), with the custom paper in the other orientation and rotated (still horizontal text on landscape paper on screen) it would error (like Unrecoverable error: configuration error stuff)

Jun 5, 2009 12:16 AM in response to Matt Broughton

Matt, appreciate your input as well. I will not get a chance to do any additional testing until tomorrow but in response to your post:

Regarding orientation of the custom size. I tried both. The continuous form (labels) I need to print to are 4.0 inches / 288 Pt / 10.2 cm wide (across the continuous form) and 1.4 inches / 100.8 Pt / 3.6 cm tall with a 0.1 inch / 7 Pt / 2.5 mm gap between labels. I generated custom paper sizes in both orientations and then rotated them accordingly in the page set up to get landscape on the screen. Generally the 4 x 1.4 orientation worked best (but with the text rotated vertically) and the 1.4 x 4 gave error messages.

I assume this is what you mean by "are you sure you have the orientation of the sizes correct". I didn't know (custom) paper had to be defined with the longer side defined on the x axis but it kind of fell into place along the way (is that assumption correct ?).

Re setting the margins, yes I picked this up along the way as well (about 2 in the morning) but even with this correct I get similar results.

FYI I was successful at inserting the custom paper sizes in the PPD, it took some jiggery pokery (delete printers, sharing on / off, couple of restarts, etc) to get the new printer definition to reflect the ppd settings but they did take.

Testing on 10.4.11, similar results depending on the driver. Errors in one rotation, rotated text in the other, the closest I got (Oki Microline IBM compatible 9 Pin with doctored ppd to include the custom page size as a default) was the correct printing but the printer was picking up its form length from a printer config (set to 6 " for another form) and the minimum setting available was 3" where we need 1.5". I assume the driver was sending a form feed command rather than driving the platen a specific distance. At that late stage I was forced to abandon 10.4.11 attempts, I cant keep hitting my head against a brick wall. So like a zombie at 2 in the morning I moved to a 10.5 machine

Testing on 10.5.7, Tried both Oki 9-Pin Series 1.3 / Microline personality (no joy) and Epson 9-Pin Series 1.3 (this is a much better driver than 1.1) / Epson FX personality but not much joy with custom page sizes, but again once I imbedded the page size into the ppd some (but frustrating) luck. I can get it to respect the paper orientation and it prints well but I could not get the form length to work properly. At best over a print run of 7 labels it would creep up the label by about 0.1 inches / 2 mm. I tried modifying the ppd embedded page size by a couple of points but it did not seem to affect things (is there a possible ppd caching issue ?) and I tried a number of custom page sizes, modifying the page size each time but not affecting the print result (again is there some sort of ppd cache working against me ?). At 3:30 in the morning I pulled the pin, I can print the text but it is creeping up the labels as they print.

Re CUPS error logs on the 10.4 machine a couple of extracts are:
E 04/Jun/2009:23:50:44 +0930 get printerattrs: resource name '/printers/LP_ppd' no good!
A number of these, I suppose as I added (lots of) printers definitions

I 05/Jun/2009:00:29:27 +0930 Job 56 queued on 'Label_printer' by 'rhettner'.
I 05/Jun/2009:00:29:27 +0930 Started filter /usr/libexec/cups/filter/cgpdftoraster (PID 506) for job 56.
I 05/Jun/2009:00:29:27 +0930 Started filter /usr/libexec/cups/filter/rastertoepson (PID 507) for job 56.
I 05/Jun/2009:00:29:27 +0930 Started backend /usr/libexec/cups/backend/lpd (PID 508) for job 56.

I really appreciate your assistance, I am well past enjoying the challenge of this. I will complete the testing some time this weekend and let you know what I find, I will stick to 10.5 / Epson 9-Pin Series 1.3 from here.

Thanks again

Jun 6, 2009 12:22 PM in response to Hetsr

Sorry for the delay in responding.


Generally the 4 x 1.4 orientation worked best (but with the text rotated vertically) and the 1.4 x 4 gave error messages.

I assume this is what you mean by "are you sure you have the orientation of the sizes correct". I didn't know (custom) paper had to be defined with the longer side defined on the x axis but it kind of fell into place along the way (is that assumption correct ?).


You may be running into some built in minimum page size restriction.

Re setting the margins, yes I picked this up along the way as well (about 2 in the morning) but even with this correct I get similar results.


I was just picking up the margins shown in the Oki-Microline IBM_compatible_9pin-okiibm.ppd. Different drivers can sometimes impose margin limitations. I did not see anything in the Ghostscript device code indicating any margin restrictions, so perhaps you could even use 0.0 in margins all around.

FYI I was successful at inserting the custom paper sizes in the PPD, it took some jiggery pokery (delete printers, sharing on / off, couple of restarts, etc) to get the new printer definition to reflect the ppd settings but they did take.


Are you working directly with the active PPD at /private/etc/cups/ppd/<printer_name> or working with the "library" version of the PPD. By "library" I mean the PPD you downloaded and have on your Desktop or somewhere else? It is the PPD at /private/etc/cups/ppd/<printer_name> that is used when printing.

When you change the ppd at /private/etc/cups/ppd/<printer_name> you do need to quit any running applications and then restart the printing system for the changes to take effect. I have been fooled too many times by not quitting the running applications and then wonder why things don't work.

Are you making all the necessary changes to the PPD? There are usually 4 places that need entries to add a new paper type:
<pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">*OpenUI #PageSize
*OpenUI *PageRegion/MediaSize
*ImageableArea
*PaperDimension</pre>

Do you run a cupstestppd on the amended PPD file after you make the changes to make sure everything meets the PPD specifications?


Testing on 10.5.7, Tried both Oki 9-Pin Series 1.3 / Microline personality (no joy) and Epson 9-Pin Series 1.3 (this is a much better driver than 1.1) / Epson FX personality but not much joy with custom page sizes,


The Oki 9-pin Series 1.3 and the Epson 9-Pin Series 1.3 should produce the same results. The only difference in the PPDs is the printer model name.

but again once I imbedded the page size into the ppd some (but frustrating) luck. I can get it to respect the paper orientation and it prints well but I could not get the form length to work properly. At best over a print run of 7 labels it would creep up the label by about 0.1 inches / 2 mm.


This might be a driver issue. It might have to do with how it treats different printer resolutions (dpi or cpi). It could also be a mechanical issue with the printer where a very small error in the amount of feed is magnified over 7 labels.

Matt

Jun 6, 2009 12:27 PM in response to Hetsr

I have had a look through Word (2004 for Mac Ver 11.5.3) and Printer setup and Print dialogue for an ability to rotate the output but no joy. No other settings spring to view that look like they would have any bearing on proceedings.


How are you using Word to produce the labels? Are you setting a document size to the size of the label or are you using the Label Tool? Some of the problem may be in how Word is handling things. Perhaps one avenue to explore is to have Word print about 8 labels using *Save as PDF*. Then print from the PDF and see how things line up.

Matt

Jun 6, 2009 7:01 PM in response to Matt Broughton

Matt Broughton wrote:
Testing on 10.5.7, Tried both Oki 9-Pin Series 1.3 / Microline personality (no joy) and Epson 9-Pin Series 1.3 (this is a much better driver than 1.1) / Epson FX personality but not much joy with custom page sizes,


The Oki 9-pin Series 1.3 and the Epson 9-Pin Series 1.3 should produce the same results. The only difference in the PPDs is the printer model name.


After some testing, I find that the output is not the same despite the two PPDs being virtually identical. I did spot in the CUPS source code for the rastertoepson filter that there is some model name matching for Epson printers. Thus I can see where the output using the Oki 9-pin PPD could be different than when using the Epson 9-pin PPD.

but again once I imbedded the page size into the ppd some (but frustrating) luck. I can get it to respect the paper orientation and it prints well but I could not get the form length to work properly. At best over a print run of 7 labels it would creep up the label by about 0.1 inches / 2 mm.


Just for the fun of it, I made some additions to the Epson 9-pin 1.3 PPD. All I can say is that I could print a job to file. I have no way to know what it would look like on paper.

I did find that using a custom paper size did add some unwanted margins to the output bounding box. Putting the custom page size into the PPD seemed to get around that issue.

I added the following lines to the Epson 9-pin PPD 1.3--
<pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">*PageSize Label1/Label1: "<</PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
*PageRegion Label1/Label1: "<<PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
*ImageableArea Label1/Label1: "0 0 288.00 107.80"
*PaperDimension Label1/Label1: "288.00 107.80"</pre>

This adds a paper size with the 4 inch (288pt) width and 1.5 inch (107.8pt) height. That represents the 1.4 inch label and the 0.1 inch gap between labels. I set 0pt margins except for the bottom where is set the 0.1 inch (7pt) gap as the bottom margin.

The full diff in context is--
<pre style="overflow: auto;font-size:small; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #ddd; padding: .3em .8em .3em .8em; font-size: 9px;">loki:~ matt$ diff -u /usr/share/cups/model/epson9.ppd ~/Desktop/epson9.ppd
--- /usr/share/cups/model/epson9.ppd 2009-02-20 20:16:53.000000000 -0600
+++ /Users/matt/Desktop/epson9.ppd 2009-06-06 20:37:06.000000000 -0500
@@ -42,6 +42,7 @@
*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
*PageSize FanFoldUS/US Fanfold: "<</PageSize[1071 792]/ImagingBBox null>>setpagedevice"
+*PageSize Label1/Label1: "<</PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize
*OpenUI *PageRegion/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageRegion
@@ -50,17 +51,20 @@
*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
*PageRegion FanFoldUS/US Fanfold: "<</PageSize[1071 792]/ImagingBBox null>>setpagedevice"
+*PageRegion Label1/Label1: "<<PageSize[288 107.8]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion
*DefaultImageableArea: Letter
*ImageableArea Letter/US Letter: "18.00 18.00 594.00 774.00"
*ImageableArea Legal/US Legal: "18.00 18.00 594.00 990.00"
*ImageableArea A4/A4: "18.00 18.00 577.00 824.00"
*ImageableArea FanFoldUS/US Fanfold: "18.00 18.00 1053.00 774.00"
+*ImageableArea Label1/Label1: "0 0 288.00 107.80"
*DefaultPaperDimension: Letter
*PaperDimension Letter/US Letter: "612.00 792.00"
*PaperDimension Legal/US Legal: "612.00 1008.00"
*PaperDimension A4/A4: "595.00 842.00"
*PaperDimension FanFoldUS/US Fanfold: "1071.00 792.00"
+*PaperDimension Label1/Label1: "288.00 107.80"
*MaxMediaWidth: "1080.00"
*MaxMediaHeight: "86400.00"
*HWMargins: 18.00 18.00 18.00 18.00</pre>

I don't know if that will help you or not. Let us know what sort of progress you make.

Matt

Jun 7, 2009 1:49 AM in response to Matt Broughton

Matt, BDAqua, all

I have progressed the 10.5 / Word / Epson Series 9-Pin / Epson FX testing and prepared a "shortish" report I will have to send to you (sorry its 4 Meg+ with images etc). If anyone else would like to have a look let me know.

Q: How can I forward / email / upload a zip archive of the printer test files (printertestfies.zip)

In short the Word / Epson Series 9-Pin / Epson FX has troubles dealing with the 1.5 inch form (height). Depending on the custom paper size it would jump from a 50 mm form length (when size set = 36 mm) to a 25 mm form length (when the size set = 30 mm). ie a non linear change.

After completing the testing / report and after reading the posts I also tried printing from File Maker Pro based PDF and Word based PDF documents and get the same result, 36 mm page height resulted in 50 mm at the printer.

Regarding which ppd am I working with, I start with the NOT private version (I didnt know where it was cached) and turn things on / off until it makes it way into the private space (very techy). I will be more careful now I understand the process / where it lives.

Regarding ppd changes I have focused on the Epson Service 9-Pin (generic) with the intention of trying to identify the root problem rather than having to many variables. Let me know if you want me to chase the Foomatic ppd Mods approach further.

If you could have a look at the CUPS error logs and let me know if it gives you any insights to what is happening I would be very appreciated, I have tried to interpret them and can follow about 5%, other than that it is Swahili to me. From there we can decide if its worth playing with the innards of the ppd files again. It would be really nice to understand what is happening as the combinations and permutations are to extensive for me to just make changes hoping to get around the problem.

Thanks again for your input

Jun 7, 2009 7:03 PM in response to Hetsr

Matt, BDAqua, all

I am having trouble getting the report and log files to you (its to big to put in a post). I do not have access to an anonymous ftp server and cant find any open anonymous ftp servers or file transfer systems that does not require knowing the address of the intended recipient.

Would it be reasonable for me to put a modified version of my Email in a post (so it cant be understood by crawlers) and people who would like to see the report / CUPS error log files can sent me an email (at their personal discretion). Obviously I would treat the addresses with respect and ensure they are used for not other purpose than this transfer.

Let me know if you think this is a reasonable approach or is a security risk. Thanks again Hetsr

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Help with custom page size support for non standard paper

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.