webdevRefinery Forum: c# multiple image-page print - webdevRefinery Forum

Jump to content

Think a topic deserves its own subforum?

Any topic that gets popular here will have a subforum made for it, as long as there are folks around who can answer questions! So if you think wdR is missing something, just talk about it here :)
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline pakbron 

  • Group: Members
  • Posts: 30
  • Joined: 12-March 10
  • Expertise:HTML,CSS,PHP,Javascript,SQL,Flash

Posted 14 June 2012 - 09:39 AM (#1)

c# multiple image-page print


making a credential software
Hi, I'm doing a credential software for a school that takes pictures, gets names... you know things like that.

My trouble is printing. I need to print two images (2025px * 1275px) And I need to do it in to a small paper size
2.126in * 3.386in or 54mm * 86mm (same size).

this is my code... but it doesnt print more than one page.
I only have one button that calls imprimirFrontal() and the images with that resolution.

Do you have any ideas?? or can you help me to fix my code?

I want to print to a CardSize.

this code is for demo... only print is not working
private void imprimirFrontal()
        {
            imagenFrontal = new Bitmap("ImagenFrontal_HD.png");
            ImagenTrasera = new Bitmap("ImagenTrasera_HD.png");
            //2.126in x 3.386in
            //54mm x 86mm
            PaperSize CardSize = new PaperSize("Card", 213, 339);
            //CardSize.RawKind = (int)PaperKind.Custom;

            PrintDocument pd = new PrintDocument();
            pd.PrinterSettings.DefaultPageSettings.PaperSize = CardSize;  
            pd.DefaultPageSettings.Landscape = true; 

            pd.PrintPage += new PrintPageEventHandler(imprimirDocumentoTrasero);
            pd.PrintPage += new PrintPageEventHandler(imprimirDocumentoFrontal);

            PrintPreviewDialog previewDialog = new PrintPreviewDialog();
            previewDialog.Document = pd;
            previewDialog.ShowDialog(); 
            //pd.Print();
        } 

        private void imprimirDocumentoFrontal(System.Object sender,
               System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawImage(imagenFrontal, 0, 0, 372, 235);
            e.HasMorePages = false;
        }
        private void imprimirDocumentoTrasero(System.Object sender,
               System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawImage(ImagenTrasera, 0, 0, 372, 235);
            e.HasMorePages = true;
        }

0


User is offline ChristopherIMAGE 

  • Group: Members
  • Posts: 3
  • Joined: 09-April 13

Posted 09 April 2013 - 10:37 PM (#2)

Check this image saving and printing in C# sample code to see it is helpful or not, im not sure. :D

public RasterEdgeImageStatus SaveAsBMP(int ImageID, String FilePath);
public RasterEdgeImageStatus SaveAsGIF(int ImageID, String FilePath);
public RasterEdgeImageStatus SaveAsPNG(int ImageID, String FilePath);
public RasterEdgeImageStatus SaveAsJP2(int ImageID, String FilePath);
public RasterEdgeImageStatus SaveAsJ2K(int ImageID, String FilePath);
public RasterEdgeImageStatus SaveAsJPEG(int ImageID, String FilePath);
public RasterEdgeImageStatus SaveAsTIFF(int ImageID, String FilePath, Boolean CMYKMode, TiffCompression
Compression);
public RasterEdgeImageStatus SaveToHTTP(int ImageID, DocumentFormat ImageFormat, int EncoderParameter, String
Address);
public RasterEdgeImageStatus PdfCreateFromMultipageTIFF(int ImageID, String PdfFileDest, Boolean PDFA, String Title,
String Author, String Subject, String Keywords, String Creator);
public RasterEdgeImageStatus SaveAsPDF(int ImageID, String FilePath, Boolean PDFA, String Title, String Author, String
Subject, String Keywords, String Creator);
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services