I have extracted the image from the document. in the extracted image, the font name is changed. In the document, the font name is Times new roman and extracted pdf font is Calibri. i have retained some document properties but have not gotten the font name. how to retain the document font name and style?
Source Code:
private static Document docSetup(Document interimDoc, Table table)
{
try
{
Document tableDoc = new Document();
DocumentBuilder builder = new DocumentBuilder(interimDoc);
builder.moveTo(table);
PageSetup sourcePageSetup = builder.getCurrentSection().getPageSetup();
tableDoc.getFirstSection().getPageSetup().setOrientation(
((Paragraph)table.getNextSibling()).getParentSection().getPageSetup().getOrientation());
tableDoc.getFirstSection().getPageSetup().setPaperSize(sourcePageSetup.getPaperSize());
tableDoc.getFirstSection().getPageSetup().setLeftMargin(sourcePageSetup.getLeftMargin());
tableDoc.getFirstSection().getPageSetup().setRightMargin(sourcePageSetup.getRightMargin());
return tableDoc;
}
catch (Exception e)
{
return interimDoc;
}
}
Input: Fig 7.docx (2.9 MB)
Regards,
Mahesh