You are viewing limited content. For full access, please sign in.

Question

Question

Export whole document using PageSet instead of some specific pages

asked on November 26, 2013

I want to export whole document as a pdf (I can export as PDF fine) but I can't find a way to export the whole document (all pages) despite of specifying some specific page(s).

e.g.

PageSet Set = new PageSet("2, 4-5"); ==> This exports specific pages and not the whole document (understandable by the code)

DocEx.ExportPdf(Document.GetDocumentInfo(DocID, Sess), Set, PdfExportOptions.None, OutputFile);

 

Please suggest that how can I export the whole document instead of specifying specific pages?

Thanks

2 0

Answers

APPROVED ANSWER
replied on December 2, 2013

Your solution mixes LFSO and DocumentServices together, which I don't recommend. You can use DocumentInfo.AllPages:

 

DocumentInfo doc = Document.GetDocumentInfo(docID, sess);

docExporter.ExportPdf(doc, doc.AllPages, PdfExportOptions.None, outputFile);

3 0
SELECTED ANSWER
replied on November 26, 2013

Worked:

 

LFDocumentPages dpages = (LFDocumentPages)doc.Pages;
int PagesCount = dpages.Count;

PageSet Set = new PageSet("1-"+PagesCount.ToString());

 

1 0

Replies

replied on November 26, 2013

One solution I could think of is:

- Get the count of the total number of pages in that document

- Pass that value to the PageSet

 

But is there a direct way of doing this?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.