200 kb -- 6mb

I

ISMAILRAJPUT

Every thing is working fine but when the print command is sent to printer
and you check the size of the file , it gives normally 5 to 6 mb per image .
But in orginal pictures are normally 200 to 300 KB.

You will see i am resizing the picture to fit in landscape area , i think
this is multiplying the size of data .

How do i compress it?

here is the code

private void menuItem1_Click(object sender, System.EventArgs e)

{

if (listView1.SelectedItems.Count > 0 )

{

try

{


// Assumes the default printer.

System.Windows.Forms.PrintPreviewDialog ppd = new PrintPreviewDialog();

System.Drawing.Printing.PrintDocument pd = new PrintDocument();

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.DefaultPageSettings.Landscape = true;

ppd.Document = pd ;

ppd.Show();

this.WindowState = System.Windows.Forms.FormWindowState.Minimized;

}

catch (Exception exp )

{

MessageBox.Show( exp.ToString(),"An error occurred while printing");


}

}

}

private void pd_PrintPage(object sender, PrintPageEventArgs ev)

{

// Draw a picture.

ev.Graphics.DrawImage(Bitmap.FromFile(listView1.SelectedItems[0].Text.ToStri
ng()),10,10,1135,800);


// Indicate that this is the last page to print.

ev.HasMorePages = false;



}
 
N

Nicholas Paldino [.NET/C# MVP]

ISMAILRAJPUT,

I don't think you will be able to compress it. The original size of the
image doesn't matter, it's the size of the image that you are sending to the
printer that matters. The only way you are going to be able to reduce the
size of this information sent to the printer is by either reducing the size
of the image, or by reducing the quality. Both options will reduce the
memory needed to store the information about the image.

Hope this helps.
 
S

Stu Smith

This is a guess, but maybe the image you are drawing is compressed (eg a
JPEG), while the data sent to a printer is probably an uncompressed bitmap.

What's the image size and colour depth? What's the printer (laser/inkjet,
resolution, colour)?
 
I

ismail Rajput

Here i found another thing, if i run this application on the server then
the size printer is receiving is 600 to 900 kb so this is justifiable
because of the resize.But on the network when i send print command from
client comps, the size is 5 to 6 mb . Can you guess why is it taking too
much overheads?

On the other hand we both are going to blaim network ? not application
itself?
 
I

ismail Rajput

Here i found another thing, if i run this application on the server then
the size printer is receiving is 600 to 900 kb so this is justifiable
because of the resize.But on the network when i send print command from
client comps, the size is 5 to 6 mb . Can you guess why is it taking too
much overheads?

On the other hand we both are going to blaim network ? not application
itself?
 
A

AlexS

Hi, ismail Rajput

You might use different printers, drivers, driver settings etc. Postscript
is not ascii and PCL is not postscript.
I don't think you have to blame network

HTH
Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top