Product: @pdftron/pdfnet-node
Product Version: 10.6.0-4
I have a functionality to convert Office documents to PDF that needs to be implemented. However, I have encountered an issue where, after conversion, some text becomes larger and overlaps.
The original document opens normally, with consistent font sizes throughout.
I am using the font resource package(font.json) attached to the document and have not made any changes to the settings.
Sample Code
const convertPDF = async () => {
const inputPath = '<inputPath>';
const outputPath = '<outputPath>';
const pdfdoc = await PDFNet.PDFDoc.create();
await pdfdoc.initSecurityHandler();
await PDFNet.WebFontDownloader.setCustomWebFontURL(
'file:///<path>'
);
await PDFNet.WebFontDownloader.enableDownloads();
await PDFNet.Convert.toPdf(pdfdoc, inputPath);
pdfdoc.save(outputPath, PDFNet.SDFDoc.SaveOptions.e_linearized);
};
Orignal:
Converted: