Package: pdfreactor-api
Python API for PDFreactor (https://www.pdfreactor.com), a HTML-to-PDF processor.This distribution package is based on(and replaces)the original API module byRealObjects.
To make use of it, you needa runningPDFreactorserverthe keys needed to access it;
depending on the server configuration:the license key (fromRealObjects; seehttps://www.pdfreactor.com/buy/)
(unless installed on the server)and / oran API key, if required by the server.FeaturesThe modulepdfreactor.apicontains the Python API version 8
(based onwrappers/python/lib/PDFreactor.pyfrom the PDFreactor tarball),
suitable to talk to PDFreactor server versions 8 to 11.ModificationsHere is an overview of the modifications in our distribution,
compared to the originalPDFreactor.py.Structural changesThe originalPDFreactormodule from the server distribution tarball is
calledpdfreactor.apihere.The exception classes have been moved
to thepdfreactor.exceptionsmodule.Compatible changesMost code reduction measures don’t affect the usage of the PDFreactor class:Generic changes to the code, e.g. Python version switches and imports
(which are executed at runtime in Python) have been moved out of the methods
to the top of the module.Code to handle options is replaced by methods and a helper function:For all methods which use aconfigargument:
If none is given, create one, to take our client information.TheconnectionSettingsoption is used by several methods and processed by
an appropriate method.A few methods accept an optionalstreamargument before another option.
This is handled by a special function as well.
Every legitimate usage should continue to work.Incompatible changesReduced the number of exception classes:All classes which inherit fromServerExceptionhave beenremoved,
as well as thePDFreactor._createServerExceptionmethod.ServerExceptionis anHTTPErrornow
and sports a few additional
read-only properties to provide the same information.This allowed us to greatly simplify the error handling code in the
conversion methods.If you wish to use all(remaining)exception classes of the package,
import from thepdfreactor.exceptionsmodule.InstallationSimply install usingpip:pip install pdfreactor-apiOr, to integrate in a project built usingzc.buildout,
add to yourbuildout.cfgscript:[buildout]
...
eggs =
    pdfreactor-apiand then runbin/buildout.Related packagespdfreactor.plone, aPloneintegrationpdfreactor.parsecfg, a configuration parserDocumentationWe expect most questions to be subject to the PDFreactor API documentation;
see:PDFreactor Support CenterPDFreactor Web service documentationExamplesSome sample scripts byRealObjectsare (minimally modified)
contained in thedocs/sample/directory:simple.pyA sample demonstrating the simple integration of PDFreactor into Python applicationsasync.pyA sample demonstrating an asynchronous integration which is recommended for medium to large documentsstream.pyA sample demonstrating how converted PDFs can be streamed, thus conserving memoryContribute(To this API distribution package:)Issue Tracker:https://github.com/visaplan/pdfreactor-api/issuesSource Code:https://github.com/visaplan/pdfreactor-apiSupportIf you are having issuesconcerning this API distribution(e.g. because of a new or modified API version byRealObjects),
please let us know;
please use theissue trackermentioned above.For issues regarding the PDFreactor itself, please refer toRealObjects.LicenseThe project is licensed under the MIT License.AuthorTobias Herp,tobias.herp@visaplan.comChangelog1.8.2 (2023-01-20)Bugfixes:In case of ServerExceptions,
the.resultattribute doesn’t contain JSON but XML text;
adjusted.pdfreactor_saysto handle this
(and don’t raise ValueErrors anymore).[tobiasherp]1.8.1[.post0] (2022-08-24)Bugfixes:Fixedissue 1, “convertAsBinary fails if apiKey is configured”
[tobiasherp]1.8.0 (2022-07-12)Initial release, providing a PDFreactor API v8.
[tobiasherp]