PHPackages                             adawolfa/isdoc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. adawolfa/isdoc

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

adawolfa/isdoc
==============

ISDOC parser and generator.

1.5.0(4mo ago)1125.2k↓11.2%1MITPHPPHP &gt;=8.3CI passing

Since Oct 13Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/adawolfa/isdoc)[ Packagist](https://packagist.org/packages/adawolfa/isdoc)[ RSS](/packages/adawolfa-isdoc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (40)Used By (0)

ISDOC
=====

[](#isdoc)

This is a PHP library for parsing and generating [ISDOC](http://www.isdoc.cz/) files.

Supports:

- ISDOC 6.0.2
- ISDOCX (read/write)
- PDF with embedded XML (read/write, requires [smalot/pdfparser](https://github.com/smalot/pdfparser))

Installation
------------

[](#installation)

```
composer require adawolfa/isdoc
```

Reading files
-------------

[](#reading-files)

```
$manager = Adawolfa\ISDOC\Manager::create();
$invoice = $manager->reader->file('filename.isdoc');

print $invoice->id;

foreach ($invoice->invoiceLines as $invoiceLine) {
    print $invoiceLine->note->content;
}
```

By default, files are deserialized into `Adawolfa\ISDOC\Schema\Invoice`. All code in that namespace is automatically generated from the official XSD schema. You can extend the base `Invoice` class and map your or your vendor's extensions.

```
use Adawolfa\ISDOC\Map;

class MyInvoice extends Adawolfa\ISDOC\Schema\Invoice
{
    #[Map('Extensions')]
    private ?MyExtensions $extensions;
}

class MyExtensions
{
    #[Map('CustomElement')]
    private string $customElement;
}

$invoice = $manager->reader->file('filename.isdoc', MyInvoice::class);
```

Writing files
-------------

[](#writing-files)

You should use the decorated `Adawolfa\ISDOC\Invoice` class when creating ISDOC files, as the constructor is more sane and with reasonable defaults. It also takes care of some of the summary fields.

```
$invoice = new ISDOC\Invoice(
    '12345',
    '00000000-0000-0000-0000-000000001234',
    DateTimeImmutable::createFromFormat('Y-m-d', '2021-08-16'),
    false,
    'CZK',
    new ISDOC\Schema\Invoice\AccountingSupplierParty(
        new ISDOC\Schema\Invoice\Party(
            new ISDOC\Schema\Invoice\PartyIdentification('12345678'),
            new ISDOC\Schema\Invoice\PartyName('Firma, a. s.'),
            new ISDOC\Schema\Invoice\PostalAddress(
                'Dlouhá',
                '1234',
                'Praha',
                '100 01',
                new ISDOC\Schema\Invoice\Country('CZ', 'Česká republika')
            )
        )
    )
);

$invoice->invoiceLines->add(
    new ISDOC\Schema\Invoice\InvoiceLine('1', '100.0', '121.0', '21.0', '100.0', '121.0',
        new ISDOC\Schema\Invoice\ClassifiedTaxCategory(
            '21',
            ISDOC\Schema\Invoice\ClassifiedTaxCategory::VAT_CALCULATION_METHOD_FROM_THE_TOP,
        ),
    )
);

$manager->writer->file($invoice, 'filename.isdoc');
```

ISDOCX
------

[](#isdocx)

ISDOCX files are supported. Either use the `.isdocx` extension or specify the file format when reading/writing.

```
$invoice = $manager->reader->file('filename.isdocx', ISDOC\Schema\Invoice::class, $manager::FORMAT_ISDOCX);
$manager->writer->file('filename.isdocx', $manager::FORMAT_ISDOCX);
```

Attachments (a.k.a. supplements) are supported out of box. When generating an ISDOCX file, use `Adawolfa\ISDOC\Invoice\Supplement`:

```
$supplement = Adawolfa\ISDOC\Invoice\Supplement::fromPath('attachment.pdf');
$invoice->supplementsList->add($supplement);
```

Digest will be computed and appended automatically (SHA1, no other algorithms are supported as of now).

When reading, a different subclass is being used:

```
foreach ($invoice->supplementsList as $supplement) {

    if ($supplement instanceof Adawolfa\ISDOC\Invoice\RemoteSupplement) {

        if (!$supplement->ok) {
            throw new Exception('Digest failed.');
        }

        $supplement->saveTo("supplements/{$supplement->filename}");

    }

}
```

PDF
---

[](#pdf)

PDF files with embedded ISDOC are supported. Either use the `.pdf` extension or specify the file format when reading/writing.

```
$invoice = $manager->reader->file('filename.pdf', ISDOC\Schema\Invoice::class, $manager::FORMAT_PDF);
$manager->writer->file('filename.pdf', $manager::FORMAT_PDF);
```

The PDF itself is added as a supplement automatically when reading. When writing, you need to add the PDF to the supplement list first:

```
$supplements = new SupplementList();
$supplements->add(Adawolfa\ISDOC\Invoice\Supplement::fromPath('invoice.pdf'));
$invoice->supplementsList = $supplements;
$manager->writer->file($invoice, 'filename.pdf');
```

The ISDOC will be appended as an embedded file in the resulting PDF, together with any other supplements.

FAQ
---

[](#faq)

#### I have a non-conforming ISDOC file that's missing a required value.

[](#i-have-a-non-conforming-isdoc-file-thats-missing-a-required-value)

You might encounter an exception like this:

```
Fatal error: Uncaught Adawolfa\ISDOC\Data\ValueException: Value VATApplicable is missing.

```

By default, the decoder hydrates (that is, decodes and assigns) all declared properties unless they are not present in the ISDOC file and have a default value. Some values are always supposed to be there, but sometimes they simply aren't because of an incomplete implementation on the issuing side.

One way to get around this is to enable the relaxed hydration mode, which causes the hydrator simply skip such properties.

```
$manager = Adawolfa\ISDOC\Manager::create($skipMissingPrimitiveValuesHydration = true);
$invoice = $manager->reader->file('filename.isdoc');
```

Do note, however, that such an object might have uninitialized properties, causing issues later on.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity36

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 94.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Recently: every ~0 days

Total

39

Last Release

123d ago

PHP version history (3 changes)1.0.0PHP &gt;=7.4

1.1.0PHP &gt;=8.0

1.4.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c7ce036cf56462e1adb20bd2ae7912f7caaa94f255f8445ddc63fadf68b9d65?d=identicon)[adawolfa](/maintainers/adawolfa)

---

Top Contributors

[![adawolfa](https://avatars.githubusercontent.com/u/92433271?v=4)](https://github.com/adawolfa "adawolfa (69 commits)")[![Zemistr](https://avatars.githubusercontent.com/u/2613208?v=4)](https://github.com/Zemistr "Zemistr (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/adawolfa-isdoc/health.svg)

```
[![Health](https://phpackages.com/badges/adawolfa-isdoc/health.svg)](https://phpackages.com/packages/adawolfa-isdoc)
```

###  Alternatives

[symfony/serializer-pack

A pack for the Symfony serializer

1.1k28.2M221](/packages/symfony-serializer-pack)[contributte/latte-parsedown-extra

ParsedownExtra / Markdown parser for Latte

10753.6k](/packages/contributte-latte-parsedown-extra)[honzabrecka/transit-php

Transit for PHP.

1831.0k1](/packages/honzabrecka-transit-php)[mathematicator-core/tokenizer

Math Tokenizer

104.9k6](/packages/mathematicator-core-tokenizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
