Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

File Size Reduction Through Code

Posted on by Microsoft Employee

Hy everyone,
       

Is there any code or library in X++ or C# which can reduce the size of SSRS report while generating PDF file through it?

Thank you   

*This post is locked for comments

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: File Size Reduction Through Code

    Hi Rashid,

    Use iText to split and merge PDF.

    Document doc = new Document(PageSize.A4, 50, 50, 25, 25);

    pdfWriter writer = PdfWriter.GetInstance(doc, ms);

    PdfContentByte contentPlacer;

    writer.SetPdfVersion(PdfWriter.PDF_VERSION_1_5);

    writer.CompressionLevel = PdfStream.BEST_COMPRESSION;

     

    string pdfFile = @"D:\Test.pdf";

    PdfReader reader = new PdfReader(pdfFile);

    PdfStamper stamper = new PdfStamper(reader, new FileStream(@"D:\Test1.pdf", FileMode.Create), PdfWriter.VERSION_1_5);

    stamper.FormFlattening = true;

    stamper.SetFullCompression();

    stamper.Close();

    I hope it will help you.

  • Sukrut Parab Profile Picture
    Sukrut Parab 71,647 Moderator on at
    RE: File Size Reduction Through Code

    If you search web using keywords like "reduce the file size through c# code"  you will get plenty of results . I am not aware of any way through x++  but try searching c# code which might help you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans