Skip to content

Commit

Permalink
Merge pull request #7 from dmserebr/master
Browse files Browse the repository at this point in the history
Fix for issue with poor text spacing in PDF
  • Loading branch information
nickrussler committed Dec 14, 2017
2 parents 51d9445 + 2c53aa2 commit 0513859
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/mimeparser/MimeMessageConverter.java
Expand Up @@ -83,6 +83,10 @@ public class MimeMessageConverter {
private static final Pattern IMG_CID_REGEX = Pattern.compile("cid:(.*?)\"", Pattern.DOTALL);
private static final Pattern IMG_CID_PLAIN_REGEX = Pattern.compile("\\[cid:(.*?)\\]", Pattern.DOTALL);

private static final String VIEWPORT_SIZE = "2480x3508";
private static final int CONVERSION_DPI = 300;
private static final int IMAGE_QUALITY = 100;

/**
* Execute a command and redirect its output to the standard output.
* @param command list of the command and its parameters
Expand Down Expand Up @@ -258,9 +262,10 @@ public String replace(Matcher m) throws Exception {
Logger.debug("Write pdf to %s", pdf.getAbsolutePath());

List<String> cmd = new ArrayList<String>(Arrays.asList("wkhtmltopdf",
"--viewport-size", "2480x3508",
"--viewport-size", VIEWPORT_SIZE,
// "--disable-smart-shrinking",
"--image-quality", "100",
"--dpi", String.valueOf(CONVERSION_DPI),
"--image-quality", String.valueOf(IMAGE_QUALITY),
"--encoding", charsetName));
cmd.addAll(extParams);
cmd.add(tmpHtml.getAbsolutePath());
Expand Down

0 comments on commit 0513859

Please sign in to comment.