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
Would you please share source and generated files along with self-dependent code snippet because shared code includes some undefined methods and variables. We will try to reproduce and investigate it in our environment. Moreover, please ensure using Aspose.PDF for Java 18.10 before sharing requested data.
Please note that latest versions of Aspose.PDF for Java API supports 1.7 and 1.8 java version alike. Moreover, attached file is downloaded as PDF type and renaming does not work as expected, so kindly share a ZIP directory containing the HTML file. Also, shared code snippet still includes undeclared or undefined variables including isLandscape, inpuFileWidth, doc etc. so we can not compile it to reproduce the scenario exactly. Please share SSCCE code so that we may proceed to help you out.
Also this is what i get when i’m trying to compile aspose.pdf-18.10 with the newest java 7 jdk - "aspose.pdf-18.10.jar(com/aspose/pdf/facades/PdfContentEditor.class): major version 52 is newer than 51, the highest major version supported by this compiler.
It is recommended that the compiler be upgraded.
"
We have been able to reproduce the issue in our environment. A ticket with ID PDFJAVA-38148 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.
Regarding the JDK, this does not appear to be an issue with Aspose.PDF for Java API but some problem with your environment variables. The API is compatible with both of the Java versions.
Regretfully, the ticket is not yet resolved as it requires more time to get fully investigated and resolved. We will let you know as soon as we have some certain updates regarding ticket resolution. Please spare us some time.