Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-generated PPD file including KANJI



Hi,

Regarding:

On Mar 8, 2004, at 9:36 PM, 山田桂一 wrote:

> Hi all,
>
> I developed a Tioga-based driver for a raster (non-PS) printer.
> It works fine on 10.1 and 10.2.
>
> But it does not work on 10.3.
>
....
>
> These messages were printed when a printer was created by
> PrinterSetupUtility.
> The "line 23" of the auto-generated PPD file for my printer is one of
> "*PageSize" entries.
>
>
> cupstestppd command says the same thing:
>
> % cupstestppd -v /etc/cups/ppd/MyPrinter.PPD
> ** FAIL ** Unable to open PPD file - Illegal option keyword string
> on line 23.
> REF: Page 19, section 3.3.

For reasons described below, CUPS is considering your PPD file to be
invalid.

> My driver supports multiple languages, and my default language is
> Japanese.
> And some of supported papers have Japanese (KANJI) names.
> The "line 23" of the file is the following:
>
> *PageSize: A4xxxxxx/A4xxxxxx: "1 dict dup PageSize[841.00
> 595.00]put
> setpagedevice"
>
> The "xxxxxx" is actually hexadecimal value 0xE6A8AA, that is a
> UTF8-encoded KANJI.
>
> The KANJI names are shown correctly on PageSetup dialog.
> But when a print job started, the job disappeared soon.
> Functions of my driver (BeginJob(), etc.) are not called at that time.
>
> After I removed KANJI characters from paper names and
> re-compile/re-install, it works.
> Print jobs are done correctly.
>
> I checked cups error_log again, and found another messages.
>
>
> - Bad case (KANJI paper names):
>
> D [...] StartJob: CFProcessPath=/usr/libexec/cups/filter/cgpdftops
> ...
> D [...] StartJob: CFProcessPath=/use/libexec/cups/filter/pstops
> ...
> D [...] [Job 1] 0 %%Title: (unknown)
> D [...] [Job 1] 0 %%Creator: (unknown)
> ...
> D [...] [Job 1] 0 %%Trailer
> D [...] [Job 1] Saw Trailer!
> D [...] [Job 1] Saw EOF!
> D [...] UpdateJob: job 1, file 0 is complete.

This indicates that your printer is being treated as a PostScript
printer. I'm not surprised about that since it can't parse your PPD
file to read information about what filter it should run when your
print job begins. I have no doubt that the results when trying to print
to this queue will be bad in various ways if your print queue's PPD
file can't be used by CUPS.

I believe I understand the reason why your PPD file can't be parsed and
have some suggestions to address what you are running into. The problem
you've encountered is due to a number of factors:
1) you are using a method of naming papers that is different than what
we suggest for Tioga drivers. More on that below.
2) by using paper names that are translated, the PPD file that is
created for you by the printing system is not a valid PPD file
3) the cups PPD parser shipped in Panther is more strict than that in
10.2.x.

Here is the detail about 1) and 2) above:
Tioga raster printer drivers supply a list of papers and their names.
The printing system is expecting the names to correspond to "standard"
paper names and provides translations of those paper names when it
displays the page setup dialog and shows the list of paper sizes that
are available for a given printer. There are macros for the "standard"
paper names in the header file PMPrinterModule.h. For example:

// Paper names must all be ISO or PPD standard names, so we've defined
constants here for
// developers to use in their code, mostly to make things more readable.

...
#define USLetter CFSTR( "na-letter" )
#define USLegal CFSTR( "na-legal" )
#define Tabloid CFSTR( "tabloid" )

#define A3 CFSTR( "iso-a3" )
#define A4 CFSTR( "iso-a4" )
#define A5 CFSTR( "iso-a5" )

...

I've removed a lot of names from the header file; this is just to give
you an idea. Please look at the header file for the complete list.

The paper related information written into the PPD file that is created
by the printing system for Tioga printer drivers is based on the names
in your PaperInfo list from your Tioga Printer Module template ticket.
The names that are used to create the PPD file are the ones used to
make PPD option keywords for the following PPD main keywords:
PaperDimension, ImageableArea, PageSize, and PageRegion. The option
keyword and the translation string for each entry are based on the
paper name you supply.

PPD main and option keywords have strict parsing rules. They can only
contain characters in the printable ascii character set but in addition
the characters ':' and '/' are not allowed. When you supply paper names
using the well defined entries from PMPrinterModule.h (and which are
translated in the UI via the Localizable.strings file in the
PrintCore.framework/Resources/xx.lproj/ file) this works fine. These
work fine because the names all fit within the PPD parsing rules. For
names that don't fit the PPD parsing rules. the names that get written
into the PPD file cause the PPD file to fail the cups parsing. We added
code in Panther to attempt to head off these kinds of problems but it
turns out the code was incomplete and didn't address all the possible
character codes that could cause illegal PPD files to be created. At a
later date in Panther development the CUPS parser was updated to be
more restrictive. Thus the result you are seeing.

It may be that you have some paper names that don't fit in the list of
names the printing system translates so you feel that you need to
provide your own translated names. At the present time we don't have a
way in Tioga printer drivers for you to provide names that are properly
translated unless the translated names, expressed as UTF8 data, follow
the PPD parsing rules. Note that this is not an issue for CUPS raster
drivers because such drivers provide a PPD explicitly so there you can
make a conforming a PPD option value for each paper name AND also
provide a separate translation string.

We are considering improving this in the future for Tioga printer
modules by allowing them to add another key to the paper info ticket
that is the name appropriate for use as an option name in a PPD file in
addition to the translated name. Right now there is no workaround that
I can see, other than to make sure that the names you use turn into
appropriately parseable PPD data.

Hope this helps understand the problem.
David
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.


References: 
 >Auto-generated PPD file including KANJI (From: 山田桂一 <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.