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.
Export PDF to separated pages
-
- Posts: 29
- Joined: Thu Jul 07, 2016 2:06 pm
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Export PDF to separated pages
Hello,
You can use the following code:
Thank you.
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);
}