• Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert multiple images to a single image for printing

 
menon sandeep
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method that gets multi page TIFF image from the URL, Converts it to a jpeg image represented by a byte array, Adds to a byte array arraylist based on the number of pages the TIFF image contains and returns the list to the caller method.

The caller method is executed in a loop for different image url's. As soon as the getDCNImageList() method returns the list, I am iterating the list and passing it to a CUPS printer. So for each byte array, I will be creating one print request. As hundreds of print requests are created at the same time, the cups server becomes unresponsive & disables it . I thought of storing all the buffered images in a list and after the entire loop gets executed, Create a multipage TIFF image and pass it to the printer, so that only one print request gets executed. But, as the number of images is unpredictable, storing the buffered images in a list may cause memory problems. Please advice if there is any other way to solve this problem.
 
Tony Docherty
Saloon Keeper
Posts: 3142
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than storing all the images in a buffer can you store the URL's in a queue and process them as and when the printer is able to accept the next set of print requests.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!