I’m trying to insert text or a picture into this pdf document (from attachment), but as a result nothing is inserted,
if I use another pdf - everything works fine.
What could be the reason?
To insert text I use this code:
public static void AddingText() {
Document document = new Document("sample.pdf");
Page pdfPage = document.getPages().get_Item(1);
TextFragment textFragment = new TextFragment("Aspose.PDF");
textFragment.setPosition(new Position(80, 700));
textFragment.getTextState().setFont(FontRepository.findFont("Verdana"));
textFragment.getTextState().setFontSize(14);
textFragment.getTextState().setForegroundColor(Color.getBlue());
textFragment.getTextState().setBackgroundColor(Color.getLightGray());
TextBuilder textBuilder = new TextBuilder(pdfPage);
textBuilder.appendText(textFragment);
document.save(_dataDir + "AddText_out.pdf");
}
[image]
document (24).pdf (30,9 КБ)