Page 1 of 1

Export PDF to separated pages

Posted: Tue Jun 04, 2019 3:22 pm
by edsonmiranda
I need to export a report to a pdf file to a server folder into separated pdf files, each pdf is a page.
For example I have a report with 30 pages named "Contract.mrt".
I need to export to 30 pdf files named Contract1.pdf, Contract2.pdf, Contract3.pdf and so on.

Re: Export PDF to separated pages

Posted: Wed Jun 05, 2019 12:10 pm
by Lech Kulikowski
Hello,

You can use the following code:

Code: Select all

report.Load();
report.Render();
for (int i = 0; i < report.RenderedPages.Count; i++)
{
    var expSettings = new StiPdfExportSettings();
    expSettings.PageRange = new StiPagesRange(i);
    report.ExportDocument(StiExportFormat.Pdf, "Contract" + i.ToString() + ".pdf", expSettings);
}
Thank you.