Rank: Newbie Groups: Member
Joined: 3/19/2021 Posts: 2
|
I am trying to create a pdf using AcmBlock manually using AcmRender and the sending it as a response . Even if i create a empty pdf. the size of pdf is too large eg 5mb in my case
Here is my code PdfDocument pdf = new PdfDocument();
AcmRender acmRender = new AcmRender(pdf, new AcmPageLayout(new AcmPadding(0)) ); AcmBlock content = new AcmBlock(); content.Style.Margin = new AcmPadding(0); content.Style.Padding = new AcmPadding(0);
// block to add content commented for now ////
acmRender.Render(content);
Context.Response.Clear(); Context.Response.ContentType = "application/pdf"; Context.Response.Charset = "utf-8"; Context.Response.AddHeader("content-disposition", $"attachment;filename=abc.pdf");
pdf.Save(Context.Response.OutputStream);
Can you please tell my what's wrong with this and why the size is to large
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, This is not normal. You can send us the PDF file and we will see what's taking up the space in the file. See here for instructions on how to send the file to us: https://www.essentialobjects.com/forum/test_project.aspxThanks
|