Forum Replies Created
Viewing 1 post (of 1 total)
-
AuthorPosts
-
in reply to: Multiple Column PDF September 2, 2016 at 18:06#29925
I should add that I also tried to get the html properly rendering in browser with dual column. I did it using this head meta:
.printDualColumn { -moz-column-count: 2; -webkit-column-count: 2; column-count: 2; }And then I surrounded the content which needs dual column printing with:
<div class="printDualColumn">It renders correctly in dual column format in the browser from the html. But when I render the html to pdf using pd4ml it does not render in two column.
@Test public void dualColumnTest2() throws Exception { PD4ML pd4ml = new PD4ML(); pd4ml.outputFormat(PD4ML.PDF); Insets insets = new Insets(10,10,10,10); pd4ml.setPageInsetsMM(insets); pd4ml.setHtmlWidth(800); pd4ml.adjustHtmlWidth(); Map<String, String> m = new HashMap<String, String>(); m.put(PD4Constants.PD4ML_MEDIA_TYPE_PRINT, "override"); pd4ml.setDynamicParams(m); String content = "" + "<html>" + "<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">" + "n.printDualColumn {n" + "tttt-moz-column-count: 2;n" + "tttt-webkit-column-count: 2;n" + "ttttcolumn-count: 2;n" + "ttt}n" + "</style></head>" + "<body>" + "Stuff before the dual-column text " + "<div class="printDualColumn">" + "Lots of text to be placed in dual columns" + "Lots of text to be placed in dual columns" + "Lots of text to be placed in dual columns" + "Lots of text to be placed in dual columns" + "</div>" + "</body></html>"; StringReader htmlInput = new StringReader(content); FileOutputStream htmlInputFile = new FileOutputStream("c:/bb/foo2.html"); htmlInputFile.write(content.getBytes()); FileOutputStream pdfOutput = new FileOutputStream("c:/bb/foo2.pdf"); pd4ml.render(htmlInput, pdfOutput); }Is there something I can do either in the css or in my java code?
-
AuthorPosts
Viewing 1 post (of 1 total)
