if i wan’t to add text to a existing pdf, is Aspose.Pdf.Kit the right product. I need to use certain truetype fonts. I can’t see any support in the PdfFileMend class for truetype fonts.
Hi Anton,
Hi Nayyer,
Hi Anton,
//add image in a PDF file<o:p></o:p>
String inputFile = "c:/pdftest/Mail_Pdf_output.pdf";
String outputFile = "c:/pdftest/FileMend_kitOut.pdf";
int[] pages = new int[] { 1 };
FormattedText text = new FormattedText("Sample Text in Rage", new FontColor(180, 0, 0), "c:/pdftest/RAGE.TTF",//path of the font,using the absolute path here
EncodingType.MacRoman,
false,
40f);
PdfFileMend mendor = new PdfFileMend(inputFile, outputFile);
mendor.addText(text, 1, 50, 400, 500, 700);
//lowerleftX < upperrightX,lowerleftY < upperrightY
mendor.addText(new FormattedText("Hello World in Helvetica", new FontColor(180, 0, 0), FontStyle.Helvetica, EncodingType.Winansi, false, 30), pages, 10, 25, 200, 200);
mendor.close();
PS, I am also moving this thread back to Aspose.Pdf.Kit product support forum.
thanks a lot.
Hi,
Hi Anton,
the sake of correction, I have logged it in our issue tracking system as PDFKITJAVA-33261. We
will investigate this issue in details and will keep you updated on the status
of a correction.
apologize for your inconvenience.
Hi,
Hi Anton,
//create PdfContentEditor object<o:p></o:p>
PdfContentEditor editor = new PdfContentEditor();
//crete TextProperties object with Font Style, Bold and Italic attributes
PdfContentEditor.TextProperties textProperties = new PdfContentEditor.TextProperties("Courier", true, true);
//set font size
textProperties.setTextSize(20);
//set font color
textProperties.setColor(java.awt.Color.red);