We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Link in PDF doc is not working as expected

Hi support,

I'm trying to convert a PDF file to HTML file, and the sentence "is in decades, it will likely pose an ongoing..." is linked, but there should not be an hyper-link in original PDF.
PDF attached.

Java Code :

import java.io.FileNotFoundException;
import com.aspose.pdf.HtmlSaveOptions;
import com.aspose.pdf.License;

public class AsposeTestPDF2 {

private static final String ASPOSE_TOTAL_JAVA_LIC_XML = "Aspose.Total.Java.lic.xml";
public static void setAsposeImagingLicense() {
License license = new License();
try {
license.setLicense(AsposeTestPDF2.class.getClassLoader().getResourceAsStream(ASPOSE_TOTAL_JAVA_LIC_XML));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) throws FileNotFoundException {
setAsposeImagingLicense();
com.aspose.pdf.Document doc = new com.aspose.pdf.Document("C:/asposePOC/tmp/test.pdf");
String outHtmlFile = "C:/asposePOC/tmp/test_.html";
// Create HtmlSaveOption with tested feature
com.aspose.pdf.HtmlSaveOptions saveOptions = new com.aspose.pdf.HtmlSaveOptions();
saveOptions.setFixedLayout(true);
saveOptions.setSplitIntoPages(true);
saveOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
saveOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
// save output as HTML
doc.save(outHtmlFile, saveOptions);
System.out.print("ww");
doc.dispose();
}
}


Regards
Dong Jian

Can someone from Aspose Support clarify this?

Hi Jian,


Thanks for contacting support and sorry for the delayed response.

I have tested the scenario using Aspose.Pdf for Java 11.6.0 and I am unable to notice any issue. As per my observations, the hyperlink is properly being rendered in HTML file. For your reference, I have also attached the output generated over my end.
Thank you Shahbaz.

You could open the html file and move the mouse to the sentence "it will likely pose an ongoin...". You will find this sentence is an hyper link. But in fact, this sentence is not a link in origin PDF (pic attached) . I don't know why it is, can you please check this?

Regards

Can anybody help this?

Hi Dong Jian,


Thanks for sharing the details.

I have again reviewed the resultant file and have managed to notice the above stated problem. For the sake of correction, I have logged it as PDFJAVA-36004 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

The issues you have found earlier (filed as PDFJAVA-36004) have been fixed in Aspose.PDF for Java 20.1.