Resource Base
Table of contents

How to get the file size in the specified format by index

From version 7.0


    You can use the method GetImageSizeWithSpecifiedType to get the file size in JPG, BMP, PNG, TIF.

    For example,

      m_ImageCore = new ImageCore();
      int FileSizeinJPG = m_ImageCore.IO.GetImageSizeWithSpecifiedType(m_ImageCore.ImageBuffer.CurrentImageIndexInBuffer, EnumImageFileFormat.WEBTW_JPG); //Calculates the file size in JPG for the current image.
  • In PDF

    Since PDF Module has been separated from version 7.0, the supported format for GetImageSizeWithSpecifiedType does not include PDF.

    If you want to get the file size in PDF format, please follow the steps below.

    Step1: Download Dynamsoft.Core.Util.cs and add it to the solution.

    Step2: Refer to the sample code.

    m_ImageCore = new ImageCore();
    m_PDFCreator = new PDFCreator();
    int FileSizeinPDF = Dynamsoft.Core.Util.GetImageSizeWithSpecifiedType(m_ImageCore, m_PDFCreator, m_ImageCore.ImageBuffer.CurrentImageIndexInBuffer, EnumImageFileFormatEx.WEBTW_PDF); //Calculates the file size in PDF for the current image.

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest Version
    © 2003–2021 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support