We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Add text stamp in PDF using Aspose.PDF for .NET - stamp position is different for margins


After updating Aspose.Pdf from 17.12 to 18.3 we’ve noticed that text stamp position is different for the same values of margins.

Please find attached test document which was converted in version 17.12 and in version 18.3 (vertical position is different).
Also i put code we used for adding text stamp:

var textStamp = new TextStamp(new Aspose.Pdf.Facades.FormattedText(content,

textStamp.BottomMargin = bottomMargin;
textStamp.RightMargin = rightMargin;
textStamp.TopMargin = topMargin;
textStamp.LeftMargin = leftMargin;


17.12.pdf (410.5 KB)
18.3.pdf (410.6 KB)


Thank you for contacting support.

We would like to share with you that your code snippet includes some undefined properties thus we were unable to reproduce the issue of different margins. However, we have tried to add a TextStamp using below code snippet but we can not notice any difference in margins. Please review attached PDF files and let us know if you find any problem. TestStamp.zip

        // Open document
        Document pdfDocument = new Document();

        //Add a page to PDF document

        // Create text stamp
        TextStamp textStamp = new TextStamp("Sample Stamp");

        // Set whether stamp is background
        textStamp.Background = false;

        // Set origin
        textStamp.XIndent = 200;
        textStamp.YIndent = 450;

        // Set text properties
        textStamp.TextState.Font = FontRepository.FindFont("Arial");
        textStamp.TextState.FontSize = 14.0F;
        textStamp.TextState.FontStyle = FontStyles.Bold;
        textStamp.TextState.FontStyle = FontStyles.Italic;
        textStamp.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);

        textStamp.BottomMargin = 100;
        textStamp.RightMargin = 100;
        textStamp.TopMargin = 100;
        textStamp.LeftMargin = 100;

        // Add stamp to particular page

        dataDir = dataDir + "TestStamp_17.12.pdf";
        // Save output document

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

Thank you for your example. It works fine unless you will add such rows:

textStamp.HorizontalAlignment = HorizontalAlignment.Right;
textStamp.VerticalAlignment = VerticalAlignment.Top;

After that text Stamp has small difference in vertical position (see attached files).
input_2018-03-28-17-11-11_21.pdf (64.3 KB)
input_2018-03-28-17-12-17_29.pdf (67.5 KB)


We would like to share with you that position of text does not appear different. Please see attached screenshot for your kind reference Compare.JPG. However, the text appears little different; for which an investigation ticket with ID PDFNET-44430 has been logged in our issue management system. The issue ID has been linked with this thread so that you will receive notification as soon as the issue is resolved.

We are sorry for the inconvenience.

Thank you. We will wait for results.

But in your image it is not clear if text in the same position as document does not have any other text to compare with. Do not use empty document - get any existed pdf file and put stamp over existed text or image to see different position of stamp - it is not big difference (3-5 pixels) and you will not see it in empty document.

Please check again comparing of my files
stamp.jpg (191.1 KB)


Thank you for elaborating it further.

We have updated the information in our issue management system regarding slight change in position. We will update you as soon as the issue is investigated and resolved.


Would you be so kind to provide us with status on the PDFNET-44430 issue?

Best regards,



Thank you for getting back to us.

We are afraid PDFNET-44430 is still pending for investigations owing to previously logged and critical tickets. We have recorded your concerns and will let you know once any update will be available in this regard.


Could you inform us if there are any updates regarding the topic?



Regretfully the issue is still pending for a resolution due to other high priority issues. We will surely inform you as soon as we have some certain updates regarding its rectification. Please spare us some time.

We are sorry for the inconvenience.


We are wondering regarding the issue’s status in Aspose.

Thank you in advance.

Best regards, Oleh


Thanks for contacting support.

Sadly, the earlier logged ticket has not been yet resolved due to other pending issues in the queue logged prior to yours. However, we will certainly inform you as soon as we have some definite updates regarding ticket resolution. Please spare us some time.

We are sorry for the inconvenience.


Could you inform us if there are any updates regarding the topic?



We regret to inform you that earlier logged issue is not yet resolved. However, we will surely inform you as soon as we have some certain news about its fix ETA. We highly appreciate your patience in this regard.

We apologize for the inconvenience.


Could you please let us know if there has been a resolution regarding this issue?



We are afraid that the earlier logged ticket has not been yet resolved. We have recorded your concerns already and will surely let you know once the ticket is resolved.

We apologize for your inconvenience.