Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Pdf size too large Options
Jigyasu
Posted: Monday, April 5, 2021 6:47:03 AM
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
eo_support
Posted: Monday, April 5, 2021 11:17:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,812
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.aspx

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.