Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: How to print multi pages in one task using ClassLibrary(MSVC)?
Started by victorsow at 11-23-2007 10:28. Topic has 4 replies.

Print Search « Previous Thread Next Thread »
  11-23-2007, 10:28
victorsow is not online. Last active: 11/26/2007 1:34:29 PM victorsow

Not Ranked
Joined on 07-24-2006
Posts 3
How to print multi pages in one task using ClassLibrary(MSVC)?
Reply Quote

We want to print all images in one directory one by one, could we print all the pages at one time?

We are using Lead tools 15 ClassLibrary, Visual Studio .net 2005.

Thanks in advance.

Best Regards
Victorsow


   Report 
  11-25-2007, 12:35
Adam Boulad is not online. Last active: 11/13/2008 4:54:42 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 490
Re: How to print multi pages in one task using ClassLibrary(MSVC)?
Reply Quote

Do you mean you want to print more than one image on the same printer page? If yes, please see these forum posts:
-http://support.leadtools.com/SupportPortal/cs/forums/5634/ShowPost.aspx
-http://support.leadtools.com/SupportPortal/cs/forums/7780/ShowPost.aspx

If you mean something else, please explain it in more details.


Adam Boulad
LEADTOOLS Technical Support

   Report 
  11-26-2007, 9:13
victorsow is not online. Last active: 11/26/2007 1:34:29 PM victorsow

Not Ranked
Joined on 07-24-2006
Posts 3
Re: How to print multi pages in one task using ClassLibrary(MSVC)?
Reply Quote
I mean print image1 on page 1, image2 on page2...
but print all the pages in one print job

something like(it can't work)

//Begin a print job

LBitmapBase MyBitmap;  
LPrint MyPrint;
 
//start page1
MyBitmap.Load(TEXT("C:\\Image1.cmp"));
MyPrint.SetBitmap(&MyBitmap);
//print page1
HDC hdcPrinter = MyPrint.Print(NULL, 0, 0, 0, 0, FALSE);
EndPage(hdcPrinter);
StartPage(hdcPrinter);
//start page2
MyBitmap.Load(TEXT("C:\\Image2.cmp"));
MyPrint.SetBitmap(&MyBitmap);
//print another page
MyPrint.Print();

//end the print job



   Report 
  11-28-2007, 5:27
Adam Boulad is not online. Last active: 11/13/2008 4:54:42 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 490
Re: How to print multi pages in one task using ClassLibrary(MSVC)?
Reply Quote

The second MyPrint.Print(); is not using the same HDC of the first Print() command, this causes the second image to be printed to a different job.

Instead, you should pass the second print command like this MyPrint.Print(hdcPrinter);

Tell me if this solves the problem for you.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  11-28-2007, 22:47
victorsow is not online. Last active: 11/26/2007 1:34:29 PM victorsow

Not Ranked
Joined on 07-24-2006
Posts 3
Re: How to print multi pages in one task using ClassLibrary(MSVC)?
Reply Quote
Thank you very much, Adam! It works very well.

The correct code is:

    //Begin a print job

    LBitmapBase MyBitmap;  
    LPrint MyPrint;

    //start page_1
    MyBitmap.Load(TEXT("C:\\Image_1.cmp"));
    MyPrint.SetBitmap(&MyBitmap);
    //print page_1
    HDC hdcPrinter = MyPrint.Print(NULL, 0, 0, 0, 0, FALSE);
    EndPage(hdcPrinter);

    //start page_2
    StartPage(hdcPrinter);
    MyBitmap.Load(TEXT("C:\\Image_2.cmp"));
    MyPrint.SetBitmap(&MyBitmap);
    //print page_2
    MyPrint.Print(hdcPrinter, 0, 0, 0, 0, FALSE);
    EndPage(hdcPrinter);
    //...
    //start page_n
    StartPage(hdcPrinter);
    MyBitmap.Load(TEXT("C:\\Image_n.cmp"));
    MyPrint.SetBitmap(&MyBitmap);
    //print page_n
    MyPrint.Print(hdcPrinter);

    //end the print job


   Report 
Post
LEAD Support Fo... » Developer » Printing » Re: How to print multi pages in one task using ClassLibrary(MSVC)?

Powered by Community Server, by Telligent Systems