We are using addpageNumber and would like to display the text to the bottom left. Can you please let me know if this is possible. We tried various coordinates and the text is always alligned center.
The mehod we are using is
public void addPageNumber(java.lang.StringformatString,
intposition,
floatleftMargin,
floatrightMargin,
floattopMargin,
floatbottomMargin)
I have tested the scenario and have observed that Position parameter of addPageNumber(…) method does not support the value to set page number stamp on Bottom-Left position. For the sake of implementation, I have
logged this requirement in our issue tracking system under New Features list as PDFNEWJAVA-33617. We will further investigate this requirement in details
and will keep you updated on the status of a correction.
However as a workaround, you may specify 0 as position parameter and set left margin value to negative so that page stamp is displayed on Bottom-Left. Please take a look over following code snippet. For your reference, I have also attached the resultant PDF generated over my end.
With the coordinates provided it is alligning text to the complete left and if the text is too long, the starting characters are trimmed off. We need to position the text in allignment with the left margin of the pdf and should be able to control the position of the text in the botton left area of the page.
The left margin of the text should be fixed and with the coordinates provided, I think the right margin is fixed and when new data is added it is moving left
The text is displayed at bottom left even with the followig coordinates but the same trimming issue
In order to display stamp on Bottom-Left position, I would suggest you to please try using PageNumberStamp class of Aspose.Pdf namespace. Please try using the following code snippet. For further information, please visit Add Page Number Stamp in a PDF File
Hi Nayyer,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
We need to implement the mentioned feature in Java and I do not see PageNumberStampin the java api reference. Please let me know if there is a way we can achieve this is Java using PdfFileStamp or any other class.
For your reference I'm mentioning the requirement once again. We should be able to add a dynamic text at the bottom of the page and it should be in alignment with the left margin of the page and the left margin position should be fixed.
First of all please accept my apologies as I shared the information related to Aspose.Pdf for .NET. Please try using the following code snippet for Aspose.Pdf for Java. Ensure that you are using latest release of Aspose.Pdf for Java 4.1.2.
[Java]
//open document<o:p></o:p>
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("input.pdf");
//create page number stamp
com.aspose.pdf.PageNumberStamp pageNumberStamp = new com.aspose.pdf.PageNumberStamp();
//whether the stamp is background
pageNumberStamp.setBackground(false);
pageNumberStamp.setFormat("Page
# of " + pdfDocument.getPages().size());
Thanks for your patience. In reference to above reported issue (PDFNEWJAVA-33617), please note we have already implemented additional positions in Aspose.Pdf for java as following. Moreover, you can also use the predefined constants: