Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Resizing images for DOC output does not work
Resizing images for DOC output does not work [message #1122416] Tue, 01 October 2013 14:49 Go to next message
Robert Walter is currently offline Robert WalterFriend
Messages: 29
Registered: July 2011
Junior Member
Hi,

we are using BIRT 4.2.2 and render with runTask + renderTask.

We have the following use case: For our report, we create and new PNG images programmatically right before a report gets created. In BIRT, we check for each image if it exceeds a maximum dimension. If so, we set the size to this maximum.

We do this with a bit of java script and it works fine for HTML and PDF. The code is defined for every image in its "on create" property.

We now added DOC as an output format. Unfortunately, the image resizing does not work for the Word output.

We use basically the same options, resp. I cannot see how the used options should be a reason for that issue:
...
case DOC:
	IRenderOption docRenderOption = new RenderOption(); 
	OutputStream docStream = createOutputStream(format);
	if (docStream != null) {
		docRenderOption.setOutputStream(docStream);
	} else {
		docRenderOption.setOutputFileName(getOutputFileName(format));
	}
	docRenderOption.setOutputFormat(getBIRTFormat(format));
	docRenderOption.setOption(IRenderOption.HTML_PAGINATION, Boolean.TRUE);
	return docRenderOption;
case PDF:
default:
	PDFRenderOption pdfRenderOption = new PDFRenderOption();
	pdfRenderOption.setOption(IPDFRenderOption.DPI, 96);
	OutputStream outputStream = createOutputStream(format);
	if (outputStream != null) {
		pdfRenderOption.setOutputStream(outputStream);
	} else {
		pdfRenderOption.setOutputFileName(getOutputFileName(format));
	}
	pdfRenderOption.setOutputFormat(getBIRTFormat(format));
	pdfRenderOption.setOption(IPDFRenderOption.PDF_HYPHENATION, Boolean.TRUE);
	pdfRenderOption.setOption(IPDFRenderOption.PDF_TEXT_WRAPPING, Boolean.TRUE);
	pdfRenderOption.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.FIT_TO_PAGE_SIZE);
	return pdfRenderOption;


Does anyone has experienced a similar problem or has an idea what causes this issue?

Thanks!

[Updated on: Tue, 01 October 2013 14:49]

Report message to a moderator

Re: Resizing images for DOC output does not work [message #1122436 is a reply to message #1122416] Tue, 01 October 2013 15:19 Go to previous message
Robert Walter is currently offline Robert WalterFriend
Messages: 29
Registered: July 2011
Junior Member
Okay, mea culpa... of course, I have to set the REnder_DPI for Doc to 96 ...:
...
docRenderOption.setOption(IRenderOption.RENDER_DPI, 96);
...
Previous Topic:Setting base URL with genReport
Next Topic:Drill-down report in java swing
Goto Forum:
  


Current Time: Tue Mar 19 02:56:40 GMT 2024

Powered by FUDForum. Page generated in 0.01923 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top