Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Can i get Aspose.Pdf.Generator.Pdf.PageCount before saving it ?

$
0
0
I am creating a Pdf like this,

  var fruitPDF = new Aspose.Pdf.Generator.Pdf();
  Section crateSection = fruitPDF.Sections.Add();
  // adding texts, paragraphs and what not here... total dynamic


now Here i need to get page counts without saving this pdf or converting it to Document Object, i am not interested in changing  Aspose.Pdf.Generator.Pdf to Aspose.PDF at the moment.

I jsst want pages so far created in fruitPDF as PageCount is coming zero when i already added content of 4 pages.

Cheers

It only works when i add this code to it.


//var tempStream = new MemoryStream();
//fruitPDF.Save(tempStream);
//tempStream.Dispose();

// Here i get the pageCount right but not without it.




************************* but then i also loose all my stuff in fruitPDF....


Viewing all articles
Browse latest Browse all 3131

Trending Articles