Supported File Formats

The following table indicates the file formats that GroupDocs.Signature for Python via .NET can work with. Here’s a simple example of how to check if a file format is supported:

import groupdocs.signature as signature

# Check if file format is supported
file_path = "document.pdf"
if signature.FileType.from_extension(file_path).is_supported():
    print(f"File format {file_path} is supported")
else:
    print(f"File format {file_path} is not supported")
FormatDescriptionBarcodeDigitalFormFieldImageMetadataQR‑codeStampText
BMPBitmap Picture (BMP)βœ…βœ…βœ…βœ…βœ…
CDRCorelDraw Vector Graphic Drawing (CDR)βœ…βœ…βœ…βœ…βœ…
CMXCorel Metafile eXchange Imageβœ…βœ…βœ…βœ…βœ…
DJVUDeja Vu (DjVu)βœ…βœ…βœ…βœ…βœ…
GIFGraphics Interchange Format (GIF)βœ…βœ…βœ…βœ…βœ…
JPG/JPEGJoint Photographic Experts Group (JPEG)βœ…βœ…βœ…βœ…βœ…βœ…
PNGPortable Network Graphics (PNG)βœ…βœ…βœ…βœ…βœ…βœ…
PSDAdobe Photoshop Document (PSD)βœ…βœ…βœ…βœ…βœ…βœ…
SVGScalable Vector Graphics (SVG)βœ…βœ…βœ…βœ…βœ…βœ…
TIF/TIFFTagged Image File Format (TIFF)βœ…βœ…βœ…βœ…βœ…βœ…
WEBPWebP Imageβœ…βœ…βœ…βœ…βœ…
WMFWindows Metafile (WMF)βœ…βœ…βœ…βœ…βœ…
PDFAdobe Portable Document Format (PDF)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
ODPOpenDocument Presentationβœ…βœ…βœ…βœ…βœ…βœ…βœ…
OTPOpenDocument Presentation Templateβœ…βœ…βœ…βœ…βœ…βœ…
POTMPowerPoint Macro‑Enabled Template (POTM)βœ…βœ…βœ…βœ…βœ…βœ…
POTXPowerPoint Template (POTX)βœ…βœ…βœ…βœ…βœ…βœ…
PPSPowerPoint 97‑2003 Slide Show (PPS)βœ…βœ…βœ…βœ…βœ…βœ…
PPSMMacro‑Enabled Slide Show (PPSM)βœ…βœ…βœ…βœ…βœ…βœ…
PPSXSlide Show (PPSX)βœ…βœ…βœ…βœ…βœ…βœ…
PPTPowerPoint 97‑2003 Presentation (PPT)βœ…βœ…βœ…βœ…βœ…βœ…
PPTMMacro‑Enabled Presentation (PPTM)βœ…βœ…βœ…βœ…βœ…βœ…
PPTXPresentation (PPTX)βœ…βœ…βœ…βœ…βœ…βœ…
ODSOpenDocument Spreadsheetβœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
OTSODS Template (OTS)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
XLSXMicrosoft Excel Worksheet (XLSX)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
XLSExcel 97‑2003 Worksheet (XLS)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
XLSBExcel Binary Worksheet (XLSB)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
XLSMMacro‑Enabled Worksheet (XLSM)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
XLTXExcel Template (XLTX)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
XLTMMacro‑Enabled Template (XLTM)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
DOCWord 97‑2003 Document (DOC)βœ…βœ…βœ…βœ…βœ…βœ…βœ…βœ…
DOCMMacro‑Enabled Document (DOCM)βœ…βœ…βœ…βœ…

Example: Working with Different File Formats

Here’s an example of how to work with different file formats in Python:

import groupdocs.signature as signature

def sign_document(input_path, output_path, signature_type="text"):
    # Initialize signature handler
    signature_handler = signature.Signature(input_path)
    
    if signature_type == "text":
        # Create text signature options
        options = signature.TextSignOptions("John Smith")
        options.set_left(100)
        options.set_top(100)
    elif signature_type == "image":
        # Create image signature options
        options = signature.ImageSignOptions("signature.png")
        options.set_left(100)
        options.set_top(100)
    elif signature_type == "digital":
        # Create digital signature options
        options = signature.DigitalSignOptions("certificate.pfx", "password")
    
    # Sign document
    signature_handler.sign(output_path, options)
    print(f"Document signed successfully: {output_path}")

# Example usage
sign_document("document.pdf", "signed.pdf", "text")
sign_document("document.docx", "signed.docx", "image")
sign_document("document.xlsx", "signed.xlsx", "digital")