Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
Table of contents

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

From version 7.0

  • In JPG, BMP, PNG, TIF

    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–2022 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support