karurkarthi / xdocreport

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

Specify encoding via GET parameters #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Can't specify encoding when using XDocReport in servlet for pdf converter

What is the expected output? What do you see instead?
Output Pdf with specific encoding

What version of the product are you using? On what operating system?
- latest
- win7

Please provide any additional information below.
I want to specify encoding for PDF converter via GET parameters? Maybe like 
this /servlet?encoding=windows-1251&...

Original issue reported on code.google.com by MrSo...@gmail.com on 30 Dec 2012 at 6:47

GoogleCodeExporter commented 9 years ago
Good idea.

I will do that as soon as I will find time.

Regards Angelo

Original comment by angelo.z...@gmail.com on 30 Dec 2012 at 10:13

GoogleCodeExporter commented 9 years ago
What about encoding, do you have time for this?

Original comment by MrSo...@gmail.com on 10 Jan 2013 at 6:04

GoogleCodeExporter commented 9 years ago
Done for 1.0.1 (see commit at 
http://code.google.com/p/xdocreport/source/detail?r=91aad0818b40e6ac0d799d5fc009
c2b4003edbd3)

The HTTP parameter name used is not "encoding", but "fontEncoding".

Original comment by angelo.z...@gmail.com on 11 Jan 2013 at 8:43

GoogleCodeExporter commented 9 years ago
Ok, can you upload it to "Downloads" section here for me to download modified 
".jar"-s?
http://code.google.com/p/xdocreport/downloads/list

Original comment by MrSo...@gmail.com on 11 Jan 2013 at 11:16

GoogleCodeExporter commented 9 years ago
I guess it will be "fr.opensagres.xdocreport.document-1.0.1.jar"?

Original comment by MrSo...@gmail.com on 11 Jan 2013 at 11:18

GoogleCodeExporter commented 9 years ago
No I cannot upload it. The "Download" section contains only released JARs.

If you wish get the snapshot versions of XDocReport, I suggest you to do that 
with maven. Please read section "Maven repository artifacts" at 
http://code.google.com/p/xdocreport/wiki/Download

You can downloadit at hand at 
https://oss.sonatype.org/content/repositories/snapshots/fr/opensagres/xdocreport
/fr.opensagres.xdocreport.document/1.0.1-SNAPSHOT/ but it's not recommended 
because this JAR can have depencies to other JAR

Original comment by angelo.z...@gmail.com on 11 Jan 2013 at 12:28

GoogleCodeExporter commented 9 years ago
I'm using JDev and don't know how to use maven projects. I've downloaded 
fr.opensagres.xdocreport.document-1.0.1-20130111.085622-18.jar and add 
fontEncoding=windows-1251 but output encoding still windows-1252

Original comment by MrSo...@gmail.com on 14 Jan 2013 at 7:32

GoogleCodeExporter commented 9 years ago
Your problem is with pdf converter or xhtml converter? fontEncoding works for 
the moment only with pdf.

I suggest you to get the sources (that you can download 
fr.opensagres.xdocreport.document-1.0.1-20130111.085622-18-sources.jar) and see 
what is the problem (set breakpoint on 
http://code.google.com/p/xdocreport/source/browse/document/fr.opensagres.xdocrep
ort.document/src/main/java/fr/opensagres/xdocreport/document/web/AbstractProcess
XDocReportServlet.java#507 )

Original comment by angelo.z...@gmail.com on 16 Jan 2013 at 2:50

GoogleCodeExporter commented 9 years ago
My problem with PDF converter. Can you try to convert my TempTest.docx like it 
is, without merging? I specify fontEncoding=UTF-8 and at this breakpoint it is 
UTF-8 but in output it still ISO-8859-1 =(

Original comment by MrSo...@gmail.com on 17 Jan 2013 at 8:15

Attachments:

GoogleCodeExporter commented 9 years ago
What do you yean mean by output?

I have uploaded your docx on our webapp demo and you can see the result with 
UTF-8 with the given URL 
http://xdocreport.opensagres.cloudbees.net/processReport?dispatch=view&reportId=
TempTest.docx&converter=PDF_XWPF&fontEncoding=UTF-8

Change the fontEncoding and you will see the result. But it seems that our 
converter is bugged with your docx.

Regards Angelo

Original comment by angelo.z...@gmail.com on 17 Jan 2013 at 9:59

GoogleCodeExporter commented 9 years ago
I converted this docx with MSOffice, and it looks fine. When I use your link 
and set fontEncoding=windows-1251 or KOI8-R the output file has encoding 
windows-1252 but when I set fontEncoding=UTF=8 output file has encoding 
ISO-8859-1 but decoding was damaged. For decoding I used 
http://www.artlebedev.ru/tools/decoder/
Maybe there is some other problems with converting?

Original comment by MrSo...@gmail.com on 17 Jan 2013 at 11:02

GoogleCodeExporter commented 9 years ago
Maybe something with prepareHTTPResponse? is there specification of encoding?

Original comment by MrSo...@gmail.com on 17 Jan 2013 at 11:55

GoogleCodeExporter commented 9 years ago
I don't understsand what you mean. The fontEncoding settings is used by the PDF 
converter (set the encoding for iText) not for encoding response. I suggest you 
to use directly the PDF converter 
http://code.google.com/p/xdocreport/wiki/XWPFConverterPDFViaIText (without 
servlet) and 
see the result with different encoding. 

Original comment by angelo.z...@gmail.com on 18 Jan 2013 at 4:33

GoogleCodeExporter commented 9 years ago
Looks like, this converter can't work with my files =( I don't really know why. 
Maybe problems with encoding. There is usual font - Arial. Looks like this 
converter eats some content. Can you offer me other PDF converter?

Original comment by MrSo...@gmail.com on 22 Jan 2013 at 7:33

GoogleCodeExporter commented 9 years ago
cleanup

Original comment by pascal.leclercq on 10 Oct 2014 at 7:37