1"use strict";(self.webpackChunkpdftools_doc=self.webpackChunkpdftools_doc||[]).push([["15491"],{944821(e,i,n){n.r(i),n.d(i,{metadata:()=>o,default:()=>p,frontMatter:()=>r,contentTitle:()=>d,toc:()=>l,assets:()=>a});var o=JSON.parse('{"id":"guides/optimize/README","title":"Compress and optimize PDF documents","description":"Learn about PDF optimization, why you need to optimize PDF documents, and how to use the Pdftools SDK to optimize your PDFs.","source":"@site/pdf-tools-sdk_versioned_docs/version-1.19/guides/optimize/README.mdx","sourceDirName":"guides/optimize","slug":"/guides/optimize/","permalink":"/docs/pdf-tools-sdk/1.19/guides/optimize/","draft":false,"unlisted":false,"tags":[{"inline":false,"label":"Pdftools sdk","permalink":"/docs/pdf-tools-sdk/1.19/tags/pdftools-sdk","description":"General documentation and guides for Pdftools SDK PDF processing library."},{"inline":false,"label":"Compress and optimize","permalink":"/docs/pdf-tools-sdk/1.19/tags/compress-and-optimize","description":"Guides on compressing and optimizing PDF files with Pdftools SDK."}],"version":"1.19","frontMatter":{"title":"Compress and optimize PDF documents","description":"Learn about PDF optimization, why you need to optimize PDF documents, and how to use the Pdftools SDK to optimize your PDFs.","keywords":["pdf optimization library","pdf optimisation library","pdf optimization sdk","pdf optimisation sdk"],"sidebar_label":"Compress and optimize","tags":["Pdftools SDK","Compress and optimize"]},"sidebar":"toolsSdk","previous":{"title":"Archive PDF to TIFF","permalink":"/docs/pdf-tools-sdk/1.19/guides/archive/archive-pdf-tiff"},"next":{"title":"Compress and optimize PDF document","permalink":"/docs/pdf-tools-sdk/1.19/guides/optimize/optimize-a-pdf"}}'),t=n(474848),s=n(28453);let r={title:"Compress and optimize PDF documents",description:"Learn about PDF optimization, why you need to optimize PDF documents, and how to use the Pdftools SDK to optimize your PDFs.",keywords:["pdf optimization library","pdf optimisation library","pdf optimization sdk","pdf optimisation sdk"],sidebar_label:"Compress and optimize",tags:["Pdftools SDK","Compress and optimize"]},d,a={},l=[{value:"Compress and optimize images",id:"compress-and-optimize-images",level:2},{value:"Optimize fonts",id:"optimize-fonts",level:2},{value:"Compress and optimize content and structure",id:"compress-and-optimize-content-and-structure",level:2}];function c(e){let i={a:"a",admonition:"admonition",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.p,{children:"The Pdftools SDK lets you optimize PDF documents to suit specific target needs such as electronic document exchange, archiving, or printing."}),"\n",(0,t.jsxs)(i.p,{children:["Many processes produce PDF documents that may not be optimized for their specific target application.\nFor example, the file size may deteriorate download times, or the same font embedded multiple times may impede printing.\nWith the Pdftools SDK, you can easily configure the process through ",(0,t.jsx)(i.a,{href:"/docs/pdf-tools-sdk/1.19/guides/optimize/optimization-profiles",children:"optimization profiles"})," and determine specific output through various configuration options."]}),"\n",(0,t.jsx)(i.p,{children:"The Pdftools SDK reads an input document and writes the corresponding output document.\nDepending on the configured optimization options, various parts of the PDF are processed as required.\nThe SDK is capable of removing redundant or alternative information, sub\xadsetting and merging font programs, downsampling images, and intelligently choosing optimal compression algorithms."}),"\n",(0,t.jsxs)(i.p,{children:["Depending on the desired output, you can ",(0,t.jsx)(i.a,{href:"#compress-and-optimize-images",children:"compress and optimize images"}),", ",(0,t.jsx)(i.a,{href:"#optimize-fonts",children:"fonts"}),", ",(0,t.jsx)(i.a,{href:"#compress-and-optimize-content-and-structure",children:"page content and document structure"}),"."]}),"\n",(0,t.jsx)(i.p,{children:"You can set the minimum PDF version of the output file. You can get a log report on the PDF file, listing fonts and images and their respective properties, and extract the number of pages."}),"\n","\n",(0,t.jsx)(i.h2,{id:"compress-and-optimize-images",children:"Compress and optimize images"}),"\n",(0,t.jsx)(i.p,{children:"Images can increase file size significantly. The Pdftools SDK optimizes image objects, letting you configure image compression by image type, choose the compression algorithm and compression quality, set color management options such as color profiles and color channels, and convert or remove image objects partially or completely."}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.strong,{children:"Compression process"})}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Separately configure compression of bitonal, indexed, and continuous (that is, color and grayscale) images"}),"\n",(0,t.jsx)(i.li,{children:"Define threshold in dots per inch (DPI) for triggering image downsampling"}),"\n",(0,t.jsx)(i.li,{children:"Define target image resolution in DPI for image downsampling"}),"\n",(0,t.jsx)(i.li,{children:"Automatically select best compression type for each image"}),"\n",(0,t.jsx)(i.li,{children:"Configure enforcement of configured compression types"}),"\n"]}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.strong,{children:"Image object handling"})}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Perform mixed raster content (MRC) optimization for images"}),"\n",(0,t.jsx)(i.li,{children:"Convert soft masks to image masks if applicable"}),"\n",(0,t.jsx)(i.li,{children:"Remove invisible parts of images"}),"\n",(0,t.jsx)(i.li,{children:"Remove images entirely and substitute by empty XObjects"}),"\n"]}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.strong,{children:"Color management"})}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Choose color management engine"}),"\n",(0,t.jsx)(i.li,{children:"Reduce the number of color channels used for images, image masks, and soft masks, if applicable"}),"\n",(0,t.jsx)(i.li,{children:"Convert colors to CMYK, RGB, or grayscale"}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"optimize-fonts",children:"Optimize fonts"}),"\n",(0,t.jsx)(i.p,{children:"If your PDF documents do not need to be edited, then there is no need to embed a font as a binary stream in the PDF document.\nYou can subset font programs, removing all unused glyphs that are not needed to reproduce the document. You can determine when to remove standard fonts and when to merge fonts and font programs."}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Subset font programs to contain only the used glyphs"}),"\n",(0,t.jsx)(i.li,{children:"Merge compatible font programs and fonts"}),"\n",(0,t.jsx)(i.li,{children:"Compress Type\xa01 fonts (convert to CFF)"}),"\n",(0,t.jsx)(i.li,{children:"Remove font programs"}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"compress-and-optimize-content-and-structure",children:"Compress and optimize content and structure"}),"\n",(0,t.jsx)(i.p,{children:"Unnecessary objects increase file size without reason. With the Pdftools SDK, you can remove these unused, redundant and unwanted objects to reduce file size and speed up rendering."}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Remove unused resources"}),"\n",(0,t.jsx)(i.li,{children:"Optimize page content automatically"}),"\n",(0,t.jsx)(i.li,{children:"Flatten or remove page annotations and form fields"}),"\n",(0,t.jsxs)(i.li,{children:["Remove unnecessary data:","\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Redun
1dant objects"}),"\n",(0,t.jsx)(i.li,{children:"Embedded standard fonts (such as Courier, Arial, and Times)"}),"\n",(0,t.jsx)(i.li,{children:"Embedded, non-symbolic fonts"}),"\n",(0,t.jsx)(i.li,{children:"Unnecessary file information"}),"\n",(0,t.jsx)(i.li,{children:"Article threads"}),"\n",(0,t.jsx)(i.li,{children:"Alternative images"}),"\n",(0,t.jsx)(i.li,{children:"Metadata"}),"\n",(0,t.jsx)(i.li,{children:"Page-piece information"}),"\n",(0,t.jsx)(i.li,{children:"Output intent"}),"\n",(0,t.jsx)(i.li,{children:"Signature appearances"}),"\n",(0,t.jsx)(i.li,{children:"Document structure tree, including markup"}),"\n",(0,t.jsx)(i.li,{children:"Miniature page preview images"}),"\n",(0,t.jsx)(i.li,{children:"Spider (web capture) information"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(i.admonition,{title:"Get started",type:"tip",children:(0,t.jsxs)(i.p,{children:["Learn ",(0,t.jsx)(i.strong,{children:(0,t.jsx)(i.a,{href:"/docs/pdf-tools-sdk/1.19/guides/optimize/optimize-a-pdf",children:"how to optimize a PDF document"})})," for a specific use."]})})]})}function p(e={}){let{wrapper:i}={...(0,s.R)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},28453(e,i,n){n.d(i,{R:()=>r,x:()=>d});var o=n(296540);let t={},s=o.createContext(t);function r(e){let i=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function d(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(s.Provider,{value:i},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.