Hello,
Thank you for your inquiry.
Please note that different components may have variations in document processing, including variances in internal algorithms and handling of document content. In the case of Spire.Pdf, we provide a "PdfCompressor" interface specifically designed for compressing PDF documents.
Below is an example code snippet for your reference:
- Code: Select all
//Load a PDF document while initializing the PdfCompressor object
PdfCompressor compressor = new PdfCompressor("input.pdf");
//Get text compression options
TextCompressionOptions textCompression = compressor.Options.TextCompressionOptions;
//Compress fonts
textCompression.CompressFonts = true;
//Unembed fonts
textCompression.UnembedFonts = true;
//Get image compression options
ImageCompressionOptions imageCompression = compressor.Options.ImageCompressionOptions;
//Resize images
imageCompression.ResizeImages = true;
//Compress images
imageCompression.CompressImage = true;
//Set the compressed image quality
imageCompression.ImageQuality = ImageQuality.High;
//Save the compressed document to file
compressor.CompressToFile("result.pdf");
Sincerely,
Annika
E-iceblue support team