Export PDF to separated pages

Stimulsoft Reports.WEB discussion
Post Reply
edsonmiranda
Posts: 29
Joined: Thu Jul 07, 2016 2:06 pm

Export PDF to separated pages

Post 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.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Export PDF to separated pages

Post 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.
Post Reply