Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, December 6, 2010 7:02:09 AM(UTC)

amurray  
amurray

Groups: Registered
Posts: 12


When I print to the virtual printer with dithering code enabled, the first page of the attached document comes out negative -- black on white. If I comment out the dithering code, the image is rendered correctly.

This happens no matter what dithering method I use: even if I set it to RasterDitheringMethod.None, the first page will be printed as a negative.

What's going on?

void printer_JobEvent(object sender, Leadtools.Printer.JobEventArgs e)
{
if (e.JobEventState == Leadtools.Printer.EventState.JobStart) {
this.currentPageNumber = 0;
}
else if (e.JobEventState == Leadtools.Printer.EventState.JobEnd) {
//// dither to 1bpp before saving
//var ditherer = new Leadtools.ImageProcessing.ColorResolutionCommand();
//ditherer.BitsPerPixel = 1;
//ditherer.DitheringMethod = Leadtools.RasterDitheringMethod.StevensonArce;
//ditherer.Run(currentImage);

// save the file to disk
string filename = Path.GetTempFileName();
codecs.Save(currentImage, filename, Leadtools.RasterImageFormat.CcittGroup4, 1);
currentImage.Dispose();

// pass the image off to the DTI application itself
LaunchImageIntoDTI(filename);

return;
}
}
File Attachment(s):
prints_negative.pdf (824kb) downloaded 29 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, December 6, 2010 8:18:20 AM(UTC)

amurray  
amurray

Groups: Registered
Posts: 12


Um. Excuse me. I meant "white on black", of course. White text in the virtual printer rendered document, on a black background, the opposite of the coloring of the original document.
 
#3 Posted : Wednesday, December 8, 2010 5:56:11 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Can you answer the following questions:
1) Which LEADTOOLS version (15, 16.5, 17, etc.) are you using?
2) If you try to open the PDF with our pre-built .NET Main Demo that ships with the toolkit and try to use the Color Resolution option from the Color => Transform menu, does it show the same behavior?
3) What is the build number (file version info) of the Leadtools.dll?
 
#4 Posted : Wednesday, December 8, 2010 7:40:25 AM(UTC)

amurray  
amurray

Groups: Registered
Posts: 12


1. LeadTools 17

2. If I save the transformed image to disk as a 1bpp CCITT4 TIF and open the tif, the first page is negative. If I save the image as a TIF without having run a transform, the first page of the TIF is not a negative.

3. 17.0.0.10
 
#5 Posted : Thursday, December 9, 2010 4:34:39 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I tried the following:
1- Browse to the following location:
Start Menu => Programs => LEADTOOLS 17 => .NET Class Libraries =>.NET Framework => 01 Imaging => 01 Main Demo
2- Open the Main 32-bit Demo.
3- Choose the 'File' => 'Open' button, and check the 'Show options dialog on open'.
4- Browse to the PDF file and press Open
5- The 'File Load Options' dialog shows, set the 'Resolution' to 300 in the 'Rasterize Document' tab.
6- Choose the 'Color Resolution' option from the Color => Transform menu.
7- Choose the following properties:
- Bits Per Pixels: 1
- Palette: Fixed
- Dither: Stevenson-Arc
I got correct results from the conversion. If you try the same steps, is the result correct? If not, please send me the a screenshot of the result you are getting and the output image in a ZIP or RAR file to support@leadtools.com
 
#6 Posted : Monday, December 13, 2010 6:21:11 AM(UTC)

amurray  
amurray

Groups: Registered
Posts: 12


Adding a line to my code to specifically use a fixed palette seems to address the issue.

ditherer.PaletteFlags = Leadtools.ImageProcessing.ColorResolutionCommandPaletteFlags.Fixed;
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.126 seconds.