![]() ![]() string fileName = "Output.pdf" //Creates a FileContentResult object by using the file contents, content type, and file name. string contentType = "application/pdf" //Define the file name. Position = 0 //Defining the ContentType for pdf file. Close ( true ) //If the position is not set to '0' then the PDF will be empty. Compress ( options ) //Creating the stream object MemoryStream stream = new MemoryStream () //Save the document into stream. ImageQuality = 50 //Assign the compression option to the document loadedDocument. CompressImages = true //Set the image quality. PdfCompressionOptions options = new PdfCompressionOptions () //Enable the compress image. Read ) //Load the existing PDF document PdfLoadedDocument loadedDocument = new PdfLoadedDocument ( docStream ) //Create a new compression option. Load an existing PDF FileStream docStream = new FileStream ( "Input.pdf", FileMode. The following example code snippet illustrates how to compress the images in existing PDF document. The ImageQuality property is used to reduce the quality of the image based on percentage value, where 100 is unchanged quality and 10 is low quality. You can compress all the images of an existing PDF document by enabling the CompressImages property and assigning ImageQuality available in PdfCompressionOptions class. ![]() NET Core, you need to include assembly reference in. To compress the existing PDF document in. The following compression techniques are used to compress the existing PDF document. You can compress the existing PDF document by using PdfLoadedDocument and PdfCompressionOptions. PDF supports compressing PDF document only in Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms. Essential PDF allows you to compress the PDF document and thereby reduce the file size in the following three ways. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |