![]() |
SignDoc SDK (C++)
5.0.0
|
This section lists the API changes between version 3.x and version 4.0 of SignDoc SDK and how to change your application to work with the new API.
SPSignDoc_4.0.dll has been built with Microsoft Visual Studio 2008 only. Thanks to the new C API and C++ wrapper in SignDocSDK-cpp.h, that DLL should work with all C++ compilers.
PDFNet is no longer used, you don't have to deploy the PDFNet DLL.
Some operations now fail if they would invalidate existing signatures or make a document which claims to be a PDF/A document no longer conform to PDF/A. If you want to perform those operations anyway, you can unsign signature fields with de::softpro::doc::SignDocDocument::clearAllSignatures(), remove signatures granting permissions with de::softpro::doc::SignDocDocument::removePermissions(), and turn a PDF/A document into a plain PDF document with de::softpro::doc::SignDocDocument::removePDFA(). See also de::softpro::doc::SignDocDocument::setShootInFoot()
Attempts to sign with a certificate that is not yet valid or no longer valid or which is not qualified for digital signatures now fail. See also de::softpro::doc::SignDocDocument::setShootInFoot().
Using a TrueType font without embedding it is no longer allowed. See also de::softpro::doc::SignDocDocument::setShootInFoot(). The default value of the "embed" attribute of the FontFiles element has been changed from "no" to "subset".
All classes now live in namespace de::softpro::doc.
SignDocPdfDocumentHandler.h and SignDocTiffDocumentHandler.h no longer exist, their contents have been merged into SignDocSDK-cpp.h. de::softpro::doc::SignDocPdfDocumentHandler and de::softpro::doc::SignDocTiffDocumentHandler objects are now created by de::softpro::doc::SignDocPdfDocumentHandler::create() and de::softpro::doc::SignDocTiffDocumentHandler::create(), respectively.
de::softpro::doc::SignDocDocument::createSignatureParameters(), de::softpro::doc::SignDocDocument::getAnnotation(), de::softpro::doc::SignDocDocument::getAttachmentStream(), and de::softpro::doc::SignDocDocument::verifySignature() now take a std::auto_ptr for their output argument. If you are using C++11 or later and prefer std::unique_ptr, you can do this:
Ditto for std::shared_ptr.
Classes SignDocGrayColor and SignDocRGBColor have been removed, all types of color are now represented by class de::softpro::doc::SignDocColor. Use the static factory methods of class de::softpro::doc::SignDocColor to create SignDocColor objects.
de::softpro::doc::SignDocDocumentLoader::registerDocumentHandlerLibrary() has been removed.
de::softpro::doc::SignDocProperty::setName() and de::softpro::doc::SignDocProperty::setType() have been removed.
vm_windows of de::softpro::doc::SignDocRenderParameters and de::softpro::doc::SignDocVerificationResult has been renamed vm_default.
Class TimeStampClient has been replaced by class de::softpro::doc::TimeStamper and is now implemented.
Function de::softpro::doc::SignDocField::isSigned() has been added. If you just need to know whether a field is signed or not, this function will be much more efficient than de::softpro::doc::SignDocDocument::verifySignature().
de::softpro::doc::SignDocDocument::setField() no longer moves or resizes fields. To force de::softpro::doc::SignDocDocument::setField() to move or resize a field, pass the de::softpro::doc::SignDocDocument::sff_move flag.
de::softpro::doc::SignDocDocument::flattenFields() now ignores signatures fields and hidden/invisible widgets; this behavior can be changed by passing appropriate flags.
de::softpro::doc::SignDocDocument::saveToFile() now can save to a new file (that is, a pathname can be passed in aPath) even if de::softpro::doc::SignDocDocument::sf_incremental is set in aFlags. de::softpro::doc::SignDocDocument::sf_incremental can also be used if the document was loaded from memory. de::softpro::doc::SignDocDocument::saveToStream() now supports de::softpro::doc::SignDocDocument::sf_incremental.
de::softpro::doc::SignDocDocument::copyToStream() now has a new argument, aFlags. Pass de::softpro::doc::SignDocDocument::ctsf_unsaved to include unsaved changes without actually saving the document.
Function de::softpro::doc::SignDocSignatureParameters::clearTextItems() has been added.
Using string parameter "OutputPath" for signing a PDF document that already contains signatures no longer break existing signatures.
A PDF document loaded from memory (or saved to a stream) can now be signed without saving to a file (ie, without setting string parameter "OutputPath"). Use de::softpro::doc::SignDocDocument::copyToStream() with 0 for aFlags to save the document after signing in that case.
By using the special value "<memory>" for string parameter "OutputPath", a PDF document loaded from a file can be signed in memory, ie, without writing to that file.
de::softpro::doc::SignDocSignatureParameters has a new string parameter, "FontName", and a new color parameter, "TextColor". They can be used to override the signature field's text field attributes or to provide a font and a color in the absence of text field attributes.
Attempts to sign a PDF document which already has signatures will fail if integer parameter "Optimize" is set to de::softpro::doc::SignDocSignatureParameters::o_optimize.
de::softpro::doc::SignDocDocumentLoader::loadFromMemory() now takes an argument which specifies whether the array of octets shall be copied or not.
InputStream and OutputStream in namespace de::softpro::spooc have been been replaced by similar classes in namespace de::softpro::doc.
de::softpro::doc::SignDocField::getEmptyFieldColor() now returns a pointer to a de::softpro::doc::SignDocColor object. You must destroy that object after use.
The type of the aOutput parameter of de::softpro::doc::SignPKCS7::signHash() and de::softpro::doc::SignPKCS7::signDetached() has been changed from std::string to std::vector<unsigned char>.
The member variables of de::softpro::doc::Point and de::softpro::doc::Rect have been renamed from m_x to mX etc.
Rect::operator==() has been removed.
SDPKCS7Source has been renamed de::softpro::doc::Source.