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

Free Support Forum - aspose.cloud

How to Add Page Numbers to Scanned PDF Document


I am using the following code snippet to add page numbers to a merged PDF document ( We have multiple PDF’s that are merged into a single PDF document) but I saw that the page numbers are not added to the documents that have an image in it and also if they are scanned documents that are .pdf extension. ( But the number is definitely incremented and the next pages after a scanned document display page numbers again )

                          PageNumberStamp stamp = new PageNumberStamp()
									Background = true,
									LeftMargin = 1,
									RightMargin = 2,
									TopMargin = 3,
									BottomMargin = 4,
									HorizontalAlignment = HorizontalAlignment.Center,
									VerticalAlignment = VerticalAlignment.Bottom,
									Opacity = 1,
									Rotate = Rotation.None,
									RotateAngle = 0,
									XIndent = 0,
									YIndent = 0,
									Zoom = 1,
									StartingNumber = 1,
									Value = "Page #",
								var response = 
       pdfApi.PostDocumentPageNumberStamps(destFileName, stamp, startPageNumber: 1);

Please let me know how can I successfully accomplish adding page numbers to all the pages of a merged PDF. Any help is greatly appreciated.

Thank you,


We will appreciate it if you please share a problematic PDF document with us. We will test the scenario and will guide you accordingly.

Hi @tilal.ahmad, I am attaching a sample scanned PDF document ( Since I cannot share the actual files here) for which I would like to add page numbers. Appreciate all your help.

sample doc.pdf (3.8 MB)

1 Like


We have tested the scenario and noticed Page number does not appear on the PDF document. So logged a ticket PDFCLOUD-2559 for further investigation and rectification. We will notify you as soon as it is resolved.

Thank you @tilal.ahmad.