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: Some Questions about Parsing data from PostScript file



David,
 
Appreciate your clear and very useful reply.
 
It looks like PDF is a better candidate for me. Besides, the filter path I need to change to below.
*cupsFilter: "application/pdf  0  pdftoMyprinter"
 
1.Under this path, no matter it is pure bitmap image file or hybrid file, all of them will pipe into pdftoMyprinter and no more pass through rastertoMyprinter. Right? 
 
2.In  Quartz 2D Programming Guide, I found the section"PDF Document Parsing" and
planed to make use of those steps to implement pdftoMyprinter. Does it fit into CUPS's filter architecture? ( calling CGPDFDocumentCreateWithURL, CGPDFDocumentIsEncrypted...)
 
Thanks again,
--Henry 
 
 
 
 
 
 
 
 
 
 
 
 
Regarding:
> My printer, it is a Laser engraver, which can accept PCL raster 
> command and HPGL vector command.
>
> 1.Because that, I had implemented a raster driver which serves 
> bitmap image file only. But for other hybrid files, like .cdr 
> or .ai, which include bitmap and vector data, I also want to 
> implement a driver to filtering PostScript file to parsing raster 
> and vector data. Is it possible?
It is possible but because of the way that cups evaluates which 
filters to run, for a given input type of data like PDF that is the 
typical type of input to the cups filter chain, the same set of 
filters will run, regardless of the content of the PDF data. Since 
most applications generate PDF data through the printing system 
regardless of the original content they are printing, I don't think 
you will achieve the effect you want.
> 2.I had successfully let the bitmap image file to output to my 
> printer. And the filter path I added in PPD file is:
> *cupsFilter: "application/vnd.cups-raster 0 rastertoMyprinter"
>
>
> If I want to add the parsing PostScript driver to PPD file and let 
> it and rastertoMyprinter driver exist at the same. Is below filter 
> path correct?
> *cupsFilter: "application/vnd.cups-postscript 0 posttoMyprinter"
Looks correct. My comments above are relevant to what you are trying 
to do.
> 3.Any sample is good for me to achieve parsing PostScript file and 
> get raster and vector data?
> (At least, I can separate this two kind of data from PostScript.)
As a general rule, Apple discourages this approach but that decision 
will be up to you. Our recommendation is to handle the cups-raster 
format and send that to your printer. If you insist on ge! tting vector 
data, text, and images rather than rendered bits, I think a 
potentially better approach than parsing PostScript data would be to 
instead accept PDF data since that is a more readily parseable form. 
Others on the mailing list are probably more likely than me to 
suggest where to find example code for doing this. It isn't a simple 
thing to do properly.

Hope this helps a bit,
David Gelphman
Graphics and Imaging Engineering
Apple Computer

___________________________________________________ 郔陔唳 Yahoo!✽藻撈�r籵�� 7.0 betaㄛ轎愐鋒繚����¦斕湖ㄐ http://messenger.yahoo.com.tw/beta.html

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/printing/email@hidden

This email sent to 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.