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 : Tuesday, June 23, 2015 1:53:25 AM(UTC)
sparcopt

Groups: Registered
Posts: 13


I'm trying to print a PDF page but the quality doesn't come out as expected.

Please see the attatched zip with the result print.
On the left you will see the expected print quality (Adobe print). On the right you will see the actual print quality with my own implementation.

This is my code

+------------------------------+
private RasterImage _rasterImage = new RasterImage();

private static PrintDocument printDocument = new PrintDocument();
printDocument.PrintPage += new PrintPageEventHandler(printDocument_PrintPage);
printDocument.PrintController = new StandardPrintController();

using (RasterCodecs codecs = new RasterCodecs())
{
_rasterImage = codecs.Load(pdfPath, i);

printDocument.Print();
}

private static void printDocument_PrintPage(object sender, PrintPageEventArgs e)
{

using (System.Drawing.Image img = RasterImageConverter.ConvertToImage(_rasterImage, ConvertToImageOptions.None))
{
e.Graphics.DrawImage(img, 0, 0);
}
}
+------------------------------+

I don't know if it's something that I'm missing from the Leadtools logic or from PrintDocument logic.

I already tried setting DisplayDepth, XResolution, YResolution... and still the same.

Can you help me?

My best regards.
File Attachment(s):
printQuality.zip (814kb) downloaded 50 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 : Tuesday, June 23, 2015 5:30:47 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Which version of LEADTOOLS (17.5, 18, 19, etc.) are you using?
If you are using LEADTOOLS v19, try to load the PDF file using high resolution (300 or above), and recheck the printing quality.
You can do this by using the following code:
+---------------+
...
codecs.Options.RasterizeDocument.Load.XResolution = 400 // Or 600
codecs.Options.RasterizeDocument.Load.YResolution = 400 // Or 600
...
_rasterImage = codecs.Load(pdfPath, i);
printDocument.Print();
...
+---------------+

If the problem persists, please send me the source PDF file that you are trying to print in a ZIP or RAR file.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, June 23, 2015 7:27:48 AM(UTC)
sparcopt

Groups: Registered
Posts: 13


It worked, it's very close to the expected result. I tried to increase the properties even further, to get the same result, but I ran out of memory.

I also have other problem that could be related to Leadtools or not. When printing with my own implementation the concept of space seems to change. It looks like everything increases by a very small value. The result is a printed page that goes beyond the bottom and beyond the right side of the paper. All of this by a very small percentage.

Do you know what's causing this?
 
#4 Posted : Wednesday, June 24, 2015 4:18:26 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

The size of the uncompressed image (in memory) becomes too large when loading the PDF file using high resolution, and it might consume the memory after loading it.
The size of the image depends on different factors such as Width, Height, BPP, resolution, etc. You can recheck the same issue using the 64-bit version of our DLLs.

If the problem persists, please send your LEADTOOLS SDK serial number to support@leadtools.com and mention this forum post in your email.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.075 seconds.