3/1/2023 0 Comments How to reduce size of pdfOptimizeResources ( optimizeOptions ) dataDir = dataDir + "FastShrinkImages_out.pdf" // Save updated document Fast // Optimize PDF document using OptimizationOptions ImageQuality = 75 // Set Imagae Compression Version to fast The following snippet demonstrates the Fast algorithm:ĭocument pdfDocument = new Document ( dataDir + "Shrinkimage.pdf" ) // Initialize OptimizationOptions To control the execution time we should set a Version property. Currently, we can use two algorithms - Standard and Fast. But again, we can manage this setting too. OptimizeResources ( optimizeOptions ) dataDir = dataDir + "ResizeImages_out.pdf" // Save updated documentĪnother important issue is the execution time. MaxResolution = 300 // Optimize PDF document using OptimizationOptions ResizeImages = true // Set MaxResolution option ImageQuality = 75 // Set ResizeImage option CompressImages = true // Set ImageQuality option OptimizationOptions () // Set CompressImages option GetDataDir_AsposePdf_Images () // Open documentĭocument pdfDocument = new Document ( dataDir + "ResizeImage.pdf" ) // Initialize OptimizationOptions Ticks // The path to the documents directory. In the following example, we shrink images by reducing ImageQuality to 50. In any case, ImageCompressionOptions should be applied. We have two ways to work with images: reduce image quality and/or change their resolution. These techniques can be applied using the OptimizeResources() method with the OptimizationOptions parameter. Currently, the OptimizeResources() method uses 5 techniques. We can also customize the optimization strategy. Save ( dataDir ) Optimization Strategy Management OptimizeResources () dataDir = dataDir + "ShrinkDocument_out.pdf" // Save updated document Note, though, that this method cannot guarantee document shrinking GetDataDir_AsposePdf_WorkingDocuments () // Open documentĭocument pdfDocument = new Document ( dataDir + "ShrinkDocument.pdf" ) // Optimize PDF document. For complete examples and data files, please go to
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |