MohamedSaeed / xdocreport

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

PDF layout is not as expected. #400

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi all,

I used the sample code to generate a PDF document out of MS Word DOCX document. 
The PDF is generated fine. However, the font is not according as expected. It 
is bigger in the generated PDF document and the size of the document is 2 pages 
instead of 1 page. 

I am not really sure what to do to fix the issue and generate a single page PDF 
document that looks exactly like the attached word document. 

What steps will reproduce the problem?
1. Use the MS Word doc attachment
2. Run the code below to generate PDF

Code:
InputStream in=new FileInputStream(new File("C://Temp//xdoc-test.docx"));
        IXDocReport report = XDocReportRegistry.getRegistry().loadReport(
                in, TemplateEngineKind.Velocity);

        // 2) Create Java model context 
        IContext context = report.createContext();
        context.put("description", "Holla");
        context.put("agreement", "Amer");
        context.put("name", "Mori");
        context.put("last","Adams");
        context.put("imei","901232323");
        context.put("transactionId","445454545454");
        OutputStream out = new FileOutputStream(new File("C://Temp//xdoc-test_Out.pdf"));
        // report.process(context, out);
        Options options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.XWPF);
        report.convert(context, options, out);

What is the expected output? What do you see instead?
Expected output is the same as the MS Word Document

What version of the product are you using? On what operating system?
xdocreport: 1.04
iText: 2.1.7
poi: 3.9

Please provide any additional information below.

Original issue reported on code.google.com by amer.alm...@gmail.com on 12 May 2014 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
Your problem is about docx->pdf converter. Today Developping a docx converter 
is very hard and I have no time today to improve it.

Thank's for adding your docx. I will see that when I will have time.

Original comment by angelo.z...@gmail.com on 12 May 2014 at 9:41

GoogleCodeExporter commented 9 years ago
I transformed the document to ODF. But I still have the same problem. 
Any recommendations about the layout of docx document? Is there something I can 
do to fix the issue? 

Original comment by amer.alm...@gmail.com on 12 May 2014 at 9:46

GoogleCodeExporter commented 9 years ago
Now your problem is about odt->pdf converter. As I said you, I have no time to 
improve it today.

Original comment by angelo.z...@gmail.com on 12 May 2014 at 9:48

GoogleCodeExporter commented 9 years ago
I need to get this task done by this week. So my question is: is the issues 
going to be fixed anytime this week?

If not, then I might need to consider other solutions. 

Please let me know. 

Original comment by amer.alm...@gmail.com on 13 May 2014 at 1:55

GoogleCodeExporter commented 9 years ago
> I need to get this task done by this week. So my question is: is the issues 
going to be fixed anytime this week?

No it will be not fixed. We develop XDocReport in our spare time, so it's hard 
to find time as soon as possible.

> If not, then I might need to consider other solutions. 
You mean other solution than XDocReport?

Original comment by angelo.z...@gmail.com on 13 May 2014 at 2:09

GoogleCodeExporter commented 9 years ago
Yes, other solution. 

Original comment by amer.alm...@gmail.com on 13 May 2014 at 2:21

GoogleCodeExporter commented 9 years ago
> Yes, other solution. 
Ok, I suggest you to try to use other converter like docx4j, perhaps you could 
have better result?

If you wish to create your report with docx as template, it doesn't exist other 
open source project which done that. 

It seems that you wish to have quick support, so payed product like docmosis or 
aspose.word for java could be better for you. 

Original comment by angelo.z...@gmail.com on 13 May 2014 at 2:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi, I have the same problem during converting odt to pdf. Did you find any 
solution? Are you planning to manage with this problem?

Original comment by jurek.ju...@gmail.com on 5 Jun 2014 at 6:53

GoogleCodeExporter commented 9 years ago
> Hi, I have the same problem during converting odt to pdf

I suggest you create an other issue and you attach your odt as this issue is 
for docx.

> Did you find any solution? 

Your problem with odt is not the same than docx, because odt has not the same 
syntax than docx.

> Are you planning to manage with this problem?

I'm very busy for the moment. I don't know when I will have time to try to fix 
your problem.

Regards Angelo

Original comment by angelo.z...@gmail.com on 5 Jun 2014 at 7:23

GoogleCodeExporter commented 9 years ago
I used docx4j. It worked for me. 

Original comment by amer.alm...@gmail.com on 5 Jun 2014 at 12:36

GoogleCodeExporter commented 9 years ago
Thanks for your reply. Did you convert odt or docx to pdf?

Original comment by jurek.ju...@gmail.com on 5 Jun 2014 at 2:56