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 : Friday, November 23, 2007 5:23:39 AM(UTC)
victorsow

Groups: Registered
Posts: 5


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

 

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 : Sunday, November 25, 2007 7:30:19 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

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

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.

 
#3 Posted : Monday, November 26, 2007 4:08:05 AM(UTC)
victorsow

Groups: Registered
Posts: 5


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


 
#4 Posted : Wednesday, November 28, 2007 12:22:09 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

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


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.
 
#5 Posted : Wednesday, November 28, 2007 5:42:05 PM(UTC)
victorsow

Groups: Registered
Posts: 5


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

 
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.074 seconds.