Hi
We are using aspose PDF JAVA, we recently moved from aspose.pdf-17.1.0 to aspose.pdf-18.9.
On the new version when using setUnderline() - the line appears on top of the text instead of under it .
example.png (21.1 KB)
we are using the following code
com.aspose.pdf.facades.PdfContentEditor tmpDoc = new com.aspose.pdf.facades.PdfContentEditor();
com.aspose.pdf.HtmlLoadOptions options = new com.aspose.pdf.HtmlLoadOptions();
com.aspose.pdf.PageInfo info = new com.aspose.pdf.PageInfo();
com.aspose.pdf.MarginInfo marginInfo = new com.aspose.pdf.MarginInfo();
marginInfo.setTop(0);
marginInfo.setRight(0);
marginInfo.setLeft(0);
info.setMargin(marginInfo);
info.setLandscape(isLandscape);
info.setWidth(inpuFileWidth);
info.setHeight(inpuFileHeight);
options.setPageInfo(info);
options.setInputEncoding("UTF-8");
com.aspose.pdf.Document pdfDoc = stripMode ? new com.aspose.pdf.Document(fwdir+"/conf/scrub_watermark/scrub_stripped_template.tmp.html",options) :
new com.aspose.pdf.Document(fwdir+"/conf/scrub_watermark/scrub_watermark_template.tmp.html",options);
pdfDoc.save(temp_filepath);
pdfDoc.close();
if(stripMode){
printLog("scrub_stripped_template was created: " + temp_filepath);
}else{
printLog("scrub_watermark_template was created: " + temp_filepath);
}
//adding uc link color and underline
tmpDoc.bindPdf(temp_filepath);
for (TextFragment outDocFragmentItem:getUcLinkTextFragmentCollectionFromPDF(tmpDoc,get_original_str)) {
outDocFragmentItem.getTextState().setUnderline(true);
outDocFragmentItem.getTextState().setForegroundColor(com.aspose.pdf.Color.getBlue());
templateUcLinksLocation.put(temp_filepath, new java.awt.Rectangle((int)outDocFragmentItem.getRectangle().getLLX(),(int)outDocFragmentItem.getRectangle().getLLY()-1,(int)outDocFragmentItem.getRectangle().getWidth(),(int)outDocFragmentItem.getRectangle().getHeight()));
}
tmpDoc.save(temp_filepath);
tmpDoc.close();
The following code worked properly on the older aspose pdf version