Dithering problems with a barcode in a PDF document

Johan Henselmans johan at netsense.nl
Mon Dec 12 06:42:41 PST 2011


Op 12/12/11 2:53 PM, Helge Blischke schreef:
> Johan Henselmans wrote:
>
>> Some years ago, I have developed a printer driver for a 200/300/600 dpi
>> boca printer that translates the black/white cupsraster images in the
>> raster of the printer.
>>
>> The printer supports downloadable fonts and has internal barcode fonts,
>> and a possibility to download images etc.
>>
>> So the filter is defined as
>>
>> Filter application/vnd.cups-raster 100 rastertoboca.
>>
>> That works well with standard data, like text and images (allthough this
>> could have some improvement...) but it is not working well with
>> barcodes: If the barcodes are small in the pdf document, then the
>> rastering is really horrible and makes the result unusable for scanning.
>> the bars look ragged, and sometime the empty space between bars is
>> completely filled up.
>>
>> The path that was used for the output was: pstoappeps| pstocupsraster|
>> rastertoboca.
>>
>> I did some measurements of the PDF: the narrowest bar in the barcode is
>> about 0.29 mm (0.029 cm), which is about 2.3  pixels at 200 dpi and 3.42
>> pixels at 300 dpi.I can imagine that this might result in pixel sometime
>> to become black, and sometime to become white, if barcode is not layed
>> out exactly on the margin of a pixel.
>>
>> Is there any way I can make this barcode look like it should be, by
>> adjusting the dithering?
>>
>> Should I consider to parse the pdf file into text and image objects and
>> feed these to the printer?
>>
>> Kind Regards,
>>
>> Johan Henselmans
>
> My suggestion is to replace the pstocupsraster filter by the latest
> gstoraster filter (see the links on the CUPS web site for details) and then
> add
> -c true setstrokeadjust
> to the array of Ghostscript options (see the documentation and look into the
> Perl script.
>
> Helge
>

Dear Helge,

I looked into the documentation (the gstoraster.pdf file) and the perl 
script.

I do not understand where I would add the "-c true setstrokeadjust". 
Where would I add this?

Also I do not understand why this filter would solve my problem. As far 
as I understand from the documentation, gstoraster fixes some 
pagerotation transformation.

Care to elaborate?


-- 
Kind Regards,

Johan Henselmans




More information about the cups-devel mailing list