JadeReport pageImage sizes

Forums for specific tips, techniques and example code
Speirs
Posts: 9
Joined: Mon Dec 17, 2012 8:58 am

JadeReport pageImage sizes

Postby Speirs » Wed Mar 13, 2013 1:36 pm

HI,
We currently use the JadeReport class to store a persistent copy of any letters that we send from our app.
They are stored as a Windows MetaFile rather than the SVG option as the quality is better, the text can be copied and pasted from the letter, and the text is searchable. Works great and have had no problems.
But... I now added a high resolution marketing image to one of our letters, its a 500k jpg, looks great, prints nice and sharp, so I don't really want to drop the size/resolution done.

However the pageImage for this one page letter is now 42Mb! How can a 500k image increase the pageImage by that much??
So I obviously don't want to do this - it makes viewing the stored letter over a thin client rather tedious.
And are there any tricks around this - like storing the image seperately then applying it as a watermark?
But pesumably once the pageImage is stored I can't change it when I go to view it by overlaying the image.

I could print it as a PDF and store tha,t which is only around 340k so nice and small, but thats a big change to the whole way we generate, store and view our letters, so not too keen on that option.

Currently our print settings are:
[JadePrinting]
PrintDataType=GDI
PrintFileFormat=EMF
GeneratedImageResolution=300

Any thoughts or ideas would be greatly appreciated.
Thanks
Stephen

User avatar
suzuki1100
Posts: 29
Joined: Tue Nov 24, 2009 12:00 pm
Location: Auckland

Re: JadeReport pageImage sizes

Postby suzuki1100 » Wed Mar 13, 2013 1:56 pm

Hi,

Inspect the instances and see how the image is stored - for the image to inflate to such a large size I'd
say its converting the image to a Bitmap before sending out.
500K is a very big image - how big is the image thats being printed?
You should be able to get a decent print with a smaller files size.

Speirs
Posts: 9
Joined: Mon Dec 17, 2012 8:58 am

Re: JadeReport pageImage sizes

Postby Speirs » Thu Mar 14, 2013 8:25 am

Hi,
Thanks for the reply, I've had a bit of a play with dropping the size and resolution of the image. I've reduced it down to 183k, it's not as sharp when printed, but not too bad, will see if the powers that be notice a difference.
But in any case I'm still not happy with the stored pageImage size - its still 12Mb, which is considerably better, but still inflated by a factor of around 65x, and 12Mb over a thin client is still not flash for a one page letter. (The exact same letter without the image is 175k)
As for the format that Binary is stored in, won't it be a windows metafile as per my print settings in the ini?

User avatar
suzuki1100
Posts: 29
Joined: Tue Nov 24, 2009 12:00 pm
Location: Auckland

Re: JadeReport pageImage sizes

Postby suzuki1100 » Thu Mar 14, 2013 7:06 pm

Hi Stephen,

IMHO opinion SVG is the better option.
Check with jade via parsys but I have a sneaking suspicion that regardless of the image type used Jade coverts the image into a bitmap
and stores that (independent of SVG or WMF).

If you were using the SVG option you could have the image stored as a binary on an object (Or JadeBytes) and inject it into the SVG prior to printing.
That way your stored pages contain no embedded images and you have a single object holding the image.
I have done something similar injecting OMR image marks dynamically into JadePrintPage SVG content.

I take it the size is in the JadePrintPage binary? I vaguely recall putting in place a compression strategy for the binary.
Added a compress and decompress method to JadeReport that iterates the printpages and compresses the binaries, obviously
decompressing before printing.
We wrapped the JadeReport in an adapter that did this for us

Try the compression and if that fails try moving the images out.

Regards Troy

Speirs
Posts: 9
Joined: Mon Dec 17, 2012 8:58 am

Re: JadeReport pageImage sizes

Postby Speirs » Wed Mar 20, 2013 8:43 am

Thanks for the reply - sorry about the delay getting back again.

Yes it is he size of the JadePrintPageBinary that is the problem, and yes we do store them compressed. Compressed they are nice and small, they compress down really well. The time to decompress isn't too bad, its calling app.printer.printReport with the decompressed JadeReport passed to it that takes all the time and waiting for it to finally show down at the thin client.

To inject it into the report before printing would be ideal. I have the images already stored seperately, they are basically just marketing stuff, and each of the generated letters already has a reference to the marketing that was put on it. It contains info such as where on the page to put the image, size of the image etc... so all the info it there to be to add it back dynamically each time, but how do I go back to one of those stored PageImages though and insert an image into and at the right location?

When generating them we print the marketing images onto the page first, then set the printPosition back to the top of the page and print our letter over the top - I presume we would do something similar when retrieving the stored pages??

User avatar
suzuki1100
Posts: 29
Joined: Tue Nov 24, 2009 12:00 pm
Location: Auckland

Re: JadeReport pageImage sizes

Postby suzuki1100 » Mon Apr 15, 2013 8:51 pm

Hi,

Yes you could use the same approach you mentioned.
Probably easier than try to inject into the SVG string.

Other wise you can inject image SVG into the print page using a base64 encoded data url of the image - have a look at - http://stackoverflow.com/questions/6249 ... map-images
This may result in faster thin client transfer as there will be no bitmap


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 20 guests