PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: data getting truncated.
   PostPosted: 03 Jul 2015, 09:38 
Hi,

i am using the below code to generate pdf,but my data is getting truncated.i.e last line of the first page and first line of the next page are not displayed.Can i get a solution that my content is not lost and is displayed properly???

public void printPDF(InputStream in, String uen, String loginId,
String coTransNo, String coTransId) {
try {
File j =
File.createTempFile(SharesConstants.TEMP_FILE, SharesConstants.DOT_PDF,
null);
java.io.FileOutputStream fos = new FileOutputStream(j);
OutputStream sos = System.out;

InputStreamReader isr =
new InputStreamReader(in, SharesConstants.UTF_8);
PD4ML pd4ml = new PD4ML();

pd4ml.getLastRenderInfo(PD4Constants.PD4ML_TOTAL_PAGES);
try {
pd4ml.enableImgSplit(Boolean.FALSE);
pd4ml.setPageSize(SharesConstants.PDF_LAND_SCAPE_VALUE ?
pd4ml.changePageOrientation(PDF_FORMAT) :
PDF_FORMAT);
} catch (Exception e) {
e.printStackTrace();
}
if (SharesConstants.PDF_UNITS_VALUE.equals(SharesConstants.MM)) {
pd4ml.setPageInsetsMM(new Insets(SharesConstants.PDF_TOP_VALUE,
SharesConstants.PDF_LEFT_VALUE,
SharesConstants.PDF_BOTTOM_VALUE,
SharesConstants.PDF_RIGHT_VALUE));
} else {
pd4ml.setPageInsets(new Insets(SharesConstants.PDF_TOP_VALUE,
SharesConstants.PDF_LEFT_VALUE,
SharesConstants.PDF_BOTTOM_VALUE,
SharesConstants.PDF_RIGHT_VALUE));
}
pd4ml.setHtmlWidth(SharesConstants.PDF_USER_SPACE_WIDTH);

pd4ml.render(isr, fos);
pd4ml.enableSmartTableBreaks(true);
pd4ml.addStyle("BODY, DIV, TD { word-wrap: break-word }", true);


if (convertToBlobAndPersistTxn(j, uen, loginId, coTransNo,coTransId)) {

} else {

}
j.deleteOnExit();
} catch (Exception e) {

e.printStackTrace();
}
}



[Reply]     [ 1 post ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share