Friday, December 7, 2018

Optimize PDF and clean it up with a simple code


Optimize PDF with easy PDF SDK

Portable Document Format is a container that consists of textual, graphical and technical information, such as fonts, metadata, color profiles, etc. With the popularity of Portable Document Format, the software to create or write a PDF file has also proliferated. Today there are thousands of software products/Applications, which create PDF files.

However, all PDFs are not created equal.

Each software product or Application is geared toward writing the PDF file, focusing on the artifacts in the PDF of interest to them. PDF writers aren’t always careful about maintaining the integrity of the PDF document, and take shortcuts in writing files. The result is still a valid PDF, conforming to PDF/A and PDF/X standards, but may have many discrepancies like:

  • Abandoned pages;
  • Abandoned images;
  • Abandoned hyperlinks;
  • Unsupported fonts.

As a PDF file gets passed among different people who use diverse software to read/write it, or by the same person feeding it to different applications, the above inconsistencies may creep into the file. This typically results in the file size growing mysteriously. Your application may remove some pages, but the file size may still grow! These PDF files are also slow to load in Acrobat Reader, or may not load at all in your software environment.

PDF file before optimization

The best way to optimize your PDF and decrees it size is removing such clutter. It all could be easily done programmatically if you have the time and the where with all to manipulate PDF files.

BCL’s eadyPDF SDK has the functionality to rectify this problem. The SDK has two functions which optimize the PDF, and bring it back to a well-knit efficient structure.

void Optimize(string InputFileName, string OutputFileName, string Password)
void Optimize2(string InputFileName, string OutputFileName, string Password, int Flags, string AdvancedOptions)

Optimizing PDF in .net environment

These functions parse the PDF file, check for unused items, and physically remove them. They also check the sanctity of all objects embedded in the PDF files. The functions take in a Password parameter, in case the PDF file is encrypted. The Optimize2 function uses a Flags parameter, which dictates if the private application data called PieceInfo, and XMP metadata is to be removed. These functions can be called explicitly which processing the PDF form your software, or can be called automatically after the call to any other method in the library. This is controlled by the Boolean OptimizeAfterEachProcess.

PDF Optimized by easyPDF SDK

Thus, no matter the source of your PDF, the easyPDF library can help you keep it optimized, so that it reduces the burden on your applications. After all, you can get the same PDF in a smaller size and of the same quality, which is ready for printing or archiving in a matter of minutes and with a few simple lines of code.

Test the optimization function today by downloading and installing easy PDF SDK free trial now.

Write comments
  1. This comment has been removed by a blog administrator.

  2. best doc to pdf converter ever

    1. The best wireless earbuds in 2020. Samsung Galaxy Buds Plus. Best wireless earbuds overall best wireless earbuds 2020. Apple AirPods Pro. Best wireless earbuds: the best Bluetooth earbuds and earphones in 2021 · Sony WF-1000XM3 · sennheiser momentum true wireless 2.

  3. PDF generated using these API are accessibility compatable? Can we make this as accessibility comparable?

  4. After website has been updated, many pdfs are not converting as before.

  5. دانلود فول آلبوم ایوان بند شامل تمام آهنگ های جدید و قدیمی ایوان بند با کیفیت ۳۲۰ و ۱۲۸ به صورت یکجا و تکی از رسانه گیتار موزیک.
    گروه ایواند بند از فواد غفاری و حسین شریفی در سال ۱۳۹۵ تشکیل شد. شاعر و ترانه سرای ایوان بند خانوم حدیث دهقان می باشد.

  6. I think the admin of this site is truly working hard for his website, as here every stuff is quality Viva TV Apk For Android

  7. It allows you to loslessly optimize PDF to reduce file size by stripping unnecessary meta data and applying compression, without affecting the quality in Reach us here

  8. with this tool you can optimize multiple file at the same time & if you want to further need to reduce the file size you can afford to lose the quality.
    For more information visit :

  9. best router 2021 for long range. Let me help you picking first long-range router for large home. I am also including a buying guide. Best Wireless Routers Under $100, $200, $300 and $500 in 2021 (WiFi 6 Routers Included). NETGEAR Nighthawk AX8 8-Stream WiFi 6 Router


© 1993 - , BCL Technologies. All other trademarks are the property of their respective owners. Privacy Policy