Hi,
After we convert html to pdf using Aspose.PDF, we found some problem in result pdf file.
- text doesn’t wrap right
- we have some space between “:” character in html but space disappear in result pdf file
this s our code:
package test.fileconvert;
import com.aspose.pdf.Document;
import com.aspose.pdf.HtmlLoadOptions;
import java.nio.file.Paths;
import java.util.Locale;
public class ConvertHTMLtoPDF {
public static void main(String[] ags) throws Exception {
String filePath = "./ArabicTest";
Locale.setDefault(new Locale("en-us"));
ConvertHTMLtoPDF_Simple(filePath);
}
private static void ConvertHTMLtoPDF_Simple(String filePath) {
// Create a HTML LoadOptions
HtmlLoadOptions options = new HtmlLoadOptions();
// Initialize document object
String htmlFileName = Paths.get(filePath, "Arabic.html").toString();
Document document = new Document(htmlFileName, options);
// Save output PDF document
document.save(Paths.get(filePath, "HTMLtoPDF.pdf").toString());
document.close();
}
}
here is html and pdf file:
testfile.zip (36.0 KB)
1.png (86.0 KB)