FAQ: Why Does my PDF File Increase In Disk Space When I Save It Using DotImage


Our PdfDecoder object uses rasterization to convert a vector based image into the pixel based AtalaImage fomat. This has a few side effects that can have an impact on the size of an output pdf:
  1. If the input pdf was in true vector format, the vector space becomes pixel space. The total number of bits required to represent the image goes from the current size to approximately:

    Bits = ColorDepth*Height*Width*Resolution

    This will result in the majority of images of this type to greatly increase in disk space required. Due to the constraints of this design of our pdf tools, there is nothing that can prevent this increase.
  2. If the input pdf was not in grayscale or color, the pixel depth becomes 8bppGrayscale or 24bppRgb. This can result in the image becoming 24 times as large as it needs to be (if the image is only truly black and white). To prevent this size increase downscale the image to the appropriate size using the GetChangedPixelFormat method of the AtalaImage
  3. If the input pdf was a single image on each frame, rasterizing can change the resolution and either increase the size or decrease the quality of the image on the frame. To avoid this use the PdfImageSource object or the AdvancedPdfDecoder KB article. Both of these methods will result in the native image being extracted from the pdf file rather than rasterized. This will remedy all three side effects listed in this article.

Additional Resources

Here are some other useful articles for opening and manipulating pdf files in DotImage:

Q10175 - HOWTO: Registering the PDF Rasterizer

Q10261 - HOWTO: Merge Two Pdf Files Into One

Q10257 - HOWTO: Use Many Framed Images Efficiently

Original Article:
Q10312 - FAQ: Why Does my PDF File Increase In Disk Space When I Save It Using DotImage