opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.2k stars 368 forks source link

docx - pdf conversion problem: Line Spacing and Character spacing greater in pdf #246

Open karbert opened 6 years ago

karbert commented 6 years ago

Conversion with PdfConverter:

import org.apache.poi.xwpf.usermodel.XWPFDocument; import fr.opensagres.poi.xwpf.converter.pdf.PdfConverter; import fr.opensagres.poi.xwpf.converter.pdf.PdfOptions; ... XWPFDocument document = null; try { document = new XWPFDocument(is); final PdfOptions pdfOptions = null; PdfConverter.getInstance().convert(document, os, pdfOptions); } catch (final Exception e) { ... } finally { document = null; }

fr.opensagres.xdocreport: last version: 2.0.1 org.apache.poi: last version: 3.17

Conversion success, but Line Spacing and Character spacing greater in pdf. From 1,5 page long docx convert 2,5 page long pdf.

angelozerr commented 6 years ago

Any contribution are welcome!

karbert commented 6 years ago

My small testdata: only 3 lines, with Times New Roman 10

input docx file: small.docx

perfect pdf created with Acrobat/Create pdf command in MS Word: small_with_acrobat.pdf

POI converted file: small_with_POI.pdf

view lines in Adobe Acrobat Pro in Edit mode: small_with_acrobat_lines small_with_poi_lines

In this 3 lines can see difference.

ballgithub commented 6 years ago

@imajic may I know where could I get your fix

SMesser commented 5 years ago

Clicking on the pull request and then on the "Files changed" tab takes you to @imagic 's patch: https://github.com/opensagres/xdocreport/pull/250/files

SMesser-WhiteHawk commented 5 years ago

Since @imajic hasn't kept his PR up-to-date and merging was blocked by merge conflicts, I forked base and merged in imajic's changes, resolved the merge conflicts, and opened a new PR here: https://github.com/opensagres/xdocreport/pull/365

Schlonz commented 2 years ago

it's 2022. Any chances that this pull request will be merged in the future?

angelozerr commented 2 years ago

If someone resolve conflict, I'm opened to merge it.

ase379 commented 2 months ago

@angelozerr There are no conflicts and in every version i am picking this snippet to avoid a formatting mess. Can you approve and merge it ?

angelozerr commented 2 months ago

@ase379 if you speak about https://github.com/opensagres/xdocreport/pull/365 github said me that there is conflicts.

If you want to create a new PR, I will be happy to merge it. Thanks.

ase379 commented 2 months ago

That is strange, in my pr view it is marked as "no conflicts".

Can you state the Problem ?

angelozerr commented 2 months ago

I see that in github:

image

I have no time to investigate the problem, please create a new PR.

ase379 commented 1 month ago

@angelozerr I made a new PR from a private fork.. can you please check it ? see #674