Hi,
Hi Senthil,
Hi,
//Save the Pdf<o:p></o:p>
pdf1.Save(“c:/pdftest/TableResult.pdf”);
// load existing PDF file<o:p></o:p>
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(pdf1);
// print page count
Console.WriteLine(doc.Pages.Count);
Hi Nayyer,
Hi Senthil,
row = tab.Rows.Add();<o:p></o:p>
//faxCoverPageCount = pdf.PageCount;
cell = row.Cells.Add("Total number of pages: $P");
.....
.....
Please feel free to contact us for any further assistance.
Best Regards,
Hi Tilal,
Hi Senthil,
Hi Tilal,
Hi Senthil,
Senthil B:1. Two pdf files2. I want to merge these 2 pdf files3. Total PageCount should be added to the 1st pdf page at specific cell (PagCount for Pdf1 + PageCount for pdf2).Hi Senthil,
Thanks for sharing the details.Adding more to Tilal’s comments, once the PDF files are concatenated and you simply need to display the total page count, you can get the page count information and add this information as TextStamp at particular page region. You may try using the following code snippet to accomplish your requirement.
[C#]// create Document object<o:p></o:p>
Document doc = new Document("c:/pdftest/facture.pdf");
// load second PDF file
Document doc2 = new Document("c:/pdftest/Updated_Page_Rotation.pdf");
// add pages of first PDF file to second document
doc2.Pages.Add(doc.Pages);
// get the page count of Document2 object (which now contains pages of both document)
//create text stamp
TextStamp textStamp = new TextStamp(doc2.Pages.Count+"");
//set origin
textStamp.XIndent = 100;
textStamp.YIndent = 100;
//add stamp to particular page (first page)
doc2.Pages[1].AddStamp(textStamp);
// save the PDF document
doc2.Save(“c:/pdftest/ConcatenatedFile_with_PageCount.pdf”);
Thanks Tilal and Nayyer.
Hi Senthil,