VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Printing Some Pages



Printing Some Pages

Post by TheHoff »

Hi

When I call the ImagePrintDocumet.Print() method it always prints all pages even when I set the "from" and "to" in the print dialogue and set PrinterSettings.PrintRange = PrintRange.SomePages

I've also tried setting manually setting "from" and "to" in printer settings.
ipd.PrinterSettings.FromPage = 2;
ipd.PrinterSettings.ToPage = 2;
My code is based on the sample code, which I must say seems bizarre. You call the .Print() method which seems to then fire an event once for each page in the image. The event uses a page count to track which page to print.
        void ipd_PrintImage(object sender, PrintImageEventArgs e)
        {
            
            if (currentPage < ic.Count)
            {
                e.Image = ic[currentPage];

                currentPage++;
                if (currentPage >= ic.Count)
                {
                    e.HasMoreImages = false;
                    currentPage = 0;
                }
                else
                {
                    e.HasMoreImages = true;
                }
            }
        }
I'm sure I could find a way round this by splitting the image up into single page images and printing the ones I want BUT the fact that you can set this property (PrinterSettings.PrintRange = PrintRange.SomePages) would suggest that this approach is not necessary.

Any help gratefully accepted :)

Mark


Re: Printing Some Pages

Post by Alex »

Hello Mark,

Please read how to print images in WinForms in the documentation:
https://www.vintasoft.com/docs/vsimaging ... Forms.html

and let me know if you will have any question or problem.

Best regards, Alexander


Page 1 from 1: 1