StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Manage width/height for dynamic image with IImageProvider #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I don't know if it would help. I search a solution for sizing pictures in the 
downloaded document correctly. see requirementPreviewGoal.pdf.
The pictures in this document were resized after the download.
The document requirementPreview.pdf shows 2 cases. The first shows just the 
size of the placeholder. For the second picture, the placeholder was set to the 
width of the page, without adjusting the height. The pictures uploaded are of 
very different sizes. 
ratioDistortion.pdf shows an other case, where the width has been set to the 
width of the paragraph maintaing the ratio of the spaceholder picture. As the 
side ratios of spaceholder and target picture are not identical, the result is 
neither satisfactory.
The goal is to have pictures to scale to the available width of the page, while 
mantaing the picture ratio.

Where and how this can be set during the generation of the page?

Original issue reported on code.google.com by juerg.br...@gmail.com on 31 Oct 2011 at 3:47

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Juerg,

I don't understand well the title of this issue and why you have attached PDF? 
I suppose you call about Dynamic image by using IImageProvider? Is that? If 
it's your question, I will change your issue title if you are agree and it 
should be cool if you attach a docx+Java code with your sample.

Dynamic image today doesn't manage with, height, ratio etc. The image take the 
same size than "template" image. Dynamic image should be improved to manage 
fixed width, height, ratio but I hav enot thought about that (where set that : 
in the docx? in the FieldsMetada?, in the IImageProvider?)

Your idea are welcome!

Regards Angelo

Original comment by angelo.z...@gmail.com on 31 Oct 2011 at 6:18

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 1 Nov 2011 at 3:45

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 1 Nov 2011 at 3:50

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 1 Nov 2011 at 3:51

GoogleCodeExporter commented 8 years ago
Hi Juerg,

I have finished to manage width/height with dynamic image for docx and odt. 
Everything is commited. You can see sample with docx+freemarker at 
http://code.google.com/p/xdocreport/source/browse/samples/fr.opensagres.xdocrepo
rt.samples.docxandfreemarker/src/fr/opensagres/xdocreport/samples/docxandfreemar
ker/DocxProjectWithFreemarkerAndImage.java?repo=samples

I must finalize ODT sample but it works with the same logic than docx. I'm 
writting wiki to explain that.

Regards Angelo

Original comment by angelo.z...@gmail.com on 3 Nov 2011 at 10:41

GoogleCodeExporter commented 8 years ago
Hi Juerg,

I have finished the wiki which explains how to manage width/height for dynamic 
image : 

 * for ODT please read http://code.google.com/p/xdocreport/wiki/ODTReportingJavaMainDynamicImage#Customize_size_of_image
 * for Docx please read http://code.google.com/p/xdocreport/wiki/DocxReportingJavaMainDynamicImage#Customize_size_of_image

You will see in this pages that you can use the original size of the image, set 
a width and compute with ration the height, etc

Hope you will like it.

Regards Angelo

Original comment by angelo.z...@gmail.com on 3 Nov 2011 at 3:26

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 19 Jan 2012 at 11:51