Skip to content

Compression can't be enabled for PDF/A compliant documents #819

@schlotzz

Description

@schlotzz

Description:
I've tried to enable compression for documents with PDF/A standard, but was not able to do so. The method setCompression() disables compression as soon pdfa_mode is active.

public function setCompression($compress=true) {
	$this->compress = false;
	if (function_exists('gzcompress')) {
		if ($compress) {
			if ( !$this->pdfa_mode) {
				$this->compress = true;
			}
		}
	}
}

Issue:
Compression cannot be enabled for PDF/A. As stated on Wikipedia, only LZW compression is forbidden within PDF/A standard due to former intellectual property constraints. DEFLATE (a.k.a. "/Filter /FlateDecode") as it is used within TCPDF, is permitted as an open and patent-free standard.

Proposed Solution:
Compression should be allowed for all PDF/A-modes.

I already tested some code changes succesfully and could offer a pull request if wanted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions