They only affect how PDF objects are written and compressed in the output PDF file.ĭeleting unused PDF objects is important for other techniques discussed below.ĭo not set PdfSaveOptions.RemoveUnusedObjects property to false Pdf.Save( "compressed.pdf", saveOptions) Īll these optimizations don't affect visible contents (text, images, bookmarks, and anything else) of the PDF document. These options are enabled by default and applied implicitly: //saveOptions.Compression = PdfCompression.Flate //saveOptions.RemoveUnusedObjects = true //saveOptions.OptimizeIndirectObjects = true //saveOptions.UseObjectStreams = true //saveOptions.WriteWithoutFormatting = true Using ( var pdf = new PdfDocument( "input.pdf")) This sample shows how to optimize PDF objects in C#: packs PDF objects to compressed object streams.compresses PDF streams with Flate encoding.When saving a PDF file, Docotic.Pdf applies the following lossless optimizations by default: Internally, a PDF file is a collection of low-level PDF objects: dictionaries, streams, arrays, and others. Let's review these compression methods in more detail. Sample to see all these techniques in action. You can use all the above to get the best compression ratio for your PDF documents. remove duplicate PDF objects (fonts, images, etc.).To try the library without evaluation mode restrictions, you may get the free time-limited license keyĭocotic.Pdf provides different optimization means: You can download the binaries of the library or use its NuGet package. Use Docotic.Pdf library to compress PDF documents in. Reducing PDF file size is especially important for archiving purposes. Smaller PDF documents are easier to transfer through network and cheaper to store. The larger images are what we want to optimize.Ĭhoose 'Faster' and we'll skip smaller images and only compress larger ones, saving time.In many cases, it is a common desire to compress and optimize PDF documents. A document with many images will take longer to compress.Ĭompressing smaller images has little effect over the overall document size. To use this option select 'grayscale' as 'image conversion'. Here's an example of a grayscale converted image: Working in a scenario where higher image resolution is needed? Click 'More options', then select '144 ppi', '288 ppi' or '720 ppi' as the maximum image PPI resolution.įor lower PDF sizes, when having a lot of images, you can convert images to grayscale. Using the standard settings images are optimized to a '72 PPI' resolution. Under 'image quality' select 'Good' or 'Best'. But, if your need it you can configure a better quality for the optimized images (even if the PDF size will be larger). Images are optimized and saved with a JPEG image quality of 65%. The compression algorithm does the following: Or, click on the 'More options' button for advanced settings. You can pick PDF files from Dropbox or Google Drive too.Įxpand the 'Upload' dropdown and select your files.Ĭlick the 'Compress' button and then 'Download' your compressed PDF. Same features as the online service, and the files never leave your computer.Ĭlick 'Upload' and select files from your local computer.ĭragging and dropping files to the page also works. Rather not upload your files and work with them offline? After processing, they are permanently deleted. Please upgrade to continue processing this document.įree users are limited to 50 pages per conversion.įree users are limited to 5 files per Rename task.īelow we show how to shrink one or multiple PDF files to reduce their file size.įiles are safely uploaded over an encrypted connection. Please upgrade to continue processing up to 100 links at once.įree users are limited to 10 pages per OCR task. Please upgrade to continue processing multiple files at once.įree users are limited to 20 pages per conversion.įree users are limited to 20 links per task. You reached your free limit of 5MB per image file.įree users are limited to a single file per task. You reached your free limit of 50 MB per file. Please upgrade to continue processing this task or break for 00:59:00. You reached your free limit of 3 tasks per hour. Please upgrade to continue processing this task. You reached your free limit of 30 files per hour. Too many requests, please try again later.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |