PDF Settings

To control how the Bold Reports® ASP.NET Web Forms Report Writer exports PDF documents, set the customization properties in the PDFOptions. Initialize the PDFOptions property with the following code snippet:

writer.PDFOptions = new PDFOptions();

How do I export reports with complex script text?

To export reports with complex script language text to PDF in the Report Writer, set the ComplexScript property of PDFOptions instance to true.

writer.PDFOptions.EnableComplexScript = true;

How do I export a report as a PDF/A-1b document?

To export a report as a PDF/A-1b document with the Report Writer, specify the PdfConformanceLevel.Pdf_A1B conformance level in the PdfConformanceLevel property.

writer.PDFOptions.PdfConformanceLevel = Syncfusion.Pdf.PdfConformanceLevel.Pdf_A1B;

How do I add custom fonts to the PDF document?

To add custom fonts to a PDF document exported by the Report Writer, add the font streams to the Fonts collection in the PDFOptions instance.

To add custom fonts to the PDF exported document, follow these steps:

  1. Add the font .ttf files to your application Resources folder.

  2. In the Solution Explorer, open the properties of the font file and set the Copy property to Output Directory as Copy always.

  3. Initialize the Font collection and add the font stream to it.

    The key value provided in the font collection should be same as in the report item font property.

    //Load Missing font stream to the pdf document
    writer.PDFOptions.Fonts = new Dictionary<string, System.IO.Stream>
    {
        { "Segoe UI", new FileStream(server.MapPath(@"\Resources\Font_file_name.ttf"), FileMode.Open, FileAccess.Read) }
    };

    If any fonts used in the report definition is not installed or available in the local system, then you should load the font stream like above code snippet.

How do I password protect an exported PDF document?

To protect a PDF document exported by the Report Writer from unauthorized users, encrypt it with a password in the Security property of PDFOptions. The following code snippet encrypts the exported document with a user-defined password.

writer.PDFOptions.Security = new Syncfusion.Pdf.Security.PdfSecurity
{
    UserPassword = "Password"
};

See also