|
My Project
|
PdfXMPPacket: make reserved 3rd party interop GetDescription non const, as we generally ensure const correctness in all the API (with limited exceptions)PdfFontConfigWrapper: Put GetFcConfig() and the constructor with FcConfig* argument under guard by the PODOFO_3RDPARTY_INTEROP_ENABLED macroPdfXMPPacket: GetDoc(), GetOrCreateDescription(), GetDescription() are now guarded by PODOFO_3RDPARTY_INTEROP_ENABLED macroPdfContent: the class is now generally not internally accessible as it was before. You can now get content fields with safe getters, or you can directly access them with operator* and operator-> overloads, possibly after checking the type, errors and warnings with GetType(), GetErrors() and GetWarnings()PdfEncodingMapFactory:WinAnsiEncodingInstance() renamed to GetWinAnsiEncodingInstancePt()MacRomanEncodingInstance() renamed to GetPtrMacRomanEncodingInstancePtr()MacExpertEncodingInstance() renamed to GetMacExpertEncodingInstancePtr()TwoBytesHorizontalIdentityEncodingInstance() renamed to GetHorizontalIdentityEncodingInstancePtr()TwoBytesVerticalIdentityEncodingInstance() renamed to GetVerticalIdentityEncodingInstancePtr()GetStandard14FontEncodingMap() renamed to GetStandard14FontEncodingInstancePtr()PdfDifferenceEncoding:NameToCodePoint(): Renamed to TryGetCodePointsFromCharName(), changed the semantics and now it returns a CodePointSpan instead of char32_tCodePointToName(): Removed. It's not so simple to have an inverse map from code points to AGL name: there are multiple AGL lists and in the same AGL list there are ambiguous mappings. You can find a safest alternative in PdfPredefinedEncodingType::TryGetCharNameFromCodePoint() but it supports a smaller character setPdfDifferenceList:PdfDifferenceMapTryGetMappedName now returns a CodePointSpan instead of char32_t in the overloadAddDifference: Removed overload with name. Use PdfDifferenceEncoding::TryGetCodePointsFromCharName() first if you need a replacementObject<T>: Renamed to ObjectAdapter<T>PdfArray: FindAtAs doesn't take a default value anymore and throws on failed lookup . Use FindAtAsSafe insteadPdfDictionary: GetKeyAs, FindKeyAs, FindKeyAsParent. doesn't take a default value anymore and throws on failed lookup . Use safe method versions insteadPdfXObjectForm: Removed HasRotation(). Rotation is zero for xobject forms and it still implements privately TryGetRotationRadians()PoDofo::TransformRectPage: Removed inputIsTransformed parameter. Now the function accepts only rect in the canonical PDF coordinate systemPdfExtension: Reworked constructor parametersPdfTokenizer:IsWhitespace, IsDelimiter, IsTokenDelimiter, IsRegular, IsPrintable to <podofo/optional/PdfUtils.h>. It doesn't seems justified to have them as part of the regular public API in PdfTokenizer. Also renamed them with IsChar suffix.IsPrintable: Renamed to IsCharASCIIPrintable. That should be the correct semantic of the methodPoDoFo::GetPdfOperator(), PoDoFo::TryGetPdfOperator(), PoDoFo::GetPdfOperatorName(), PoDoFo::TryGetPdfOperatorName(): Make them private, include <podofo/optional/PdfConvert.h> for substitutesPoDoFo::GetOperandCount(), PoDoFo::TryGetOperandCount(): Make them private, no substitute providedPdfPageMode:DontCare (which was something like a pointless "ignore")UseBookmarks -> UseOutlines: "bookmark" is not really part of PDF terminologyPdfPageLayout:Ignore (pointless)Default: just use nullptr in PdfCatalog::SetPageLayout()GIDMap: Removed, it was just a infrastructural typedefPdfCIDToGIDMap: Removed HasGlyphAccess, this map is always for accessing font program GIDsPdfGlyphAccess: Width renamed to ReadMetricsMatrix2D: Removed, all methods using it were converted to use Matrix instead, which is a full replacementMatrix: Removed FromCoefficients(), just use the now public constructor with coefficientsPdfTilingPattern, PdfShadingPatter: Wholly changed API and semantics. See PdfTilingPatternDefinition and PdfShadingPatternDefinitionPdfPainter:SetTilingPattern, SetShadingPattern, SetStrokingShadingPattern, SetStrokingTilingPattern: Removed, use the SetStrokingPattern,SetShadingPattern, SetStrokingUncolouredTilingPattern, SetNonStrokingUncolouredTilingPatternPdfPainterFlags in the constructor and moved to the SetCanvas(canvas, flags) method insteadPdfFontMetrics:GetFontNameSafe() removed: Just use GetFontName insteadGetBaseFontName(): make it protected, GeFamilyFontNameSafe() it's the closest substituteGetBaseFontNameSafe(): removed, GeFamilyFontNameSafe() it's the closest substituteGetBoundingBox() now returns CornersTryGetImplicitEncoding(): removed, no substitute supplied. Retrieving a implicit encoding it's more involutedGetCIDToGIDMap(): removed, no substitute supplied. CID to GID mappings can be retrieved only from the fontPdfFontMatchBehaviorFlags: MatchPostScriptName inverted logic and renamed to SkipMatchPostScriptNamePdfFontConfigSearchFlags: MatchPostScriptName inverted logic and renamed to SkipMatchPostScriptNamePdfContentType:EndXObjectForm -> EndFormXObjectDoXObject is issued for Form XObject only if PdfContentReaderFlags::SkipFollowFormXObjects is passed, otherwise BeginXObjectForm is issuedPdfContentReaderFlags: Renamed DontFollowXObjectForms -> SkipFollowFormXObjectsPdfFont:IsCIDKeyed() -> IsCIDFont(), which is less confusingAddSubsetGIDs -> AddSubsetCIDsTryGetSubstituteFont -> TryCreateProxyFontGetUsedGIDs: it was more implementation detail for various embedding operationsPdfFontFileType:CIDType1. Just use Type1 insteadOpenType -> OpenTypeCFFPdfFontCIDType0 -> PdfFontCIDCFFPdfFontType::CIDType1 -> PdfFontType::CIDCFFPdfTextBox/PdChoiceField: Fixed Spellchecking casing to SpellCheckingPdfDrawTextMultiLineParams:Clip and renamed to SkipClipSkipSpaces and renamed to PreserveTrailingSpacesPdfVariant/PdfObect: GetDataTypeString() now returns string_view instead of const char*PdfErrorCode:FreeType -> FreeTypeErrorOpenSSL -> OpenSSLErrorInvalidDeviceOperation -> IOErrorNoPdfFile -> InvalidPDFNoObject -> ObjectNotFoundNoTrailer -> InvalidTrailerNoEOFToken -> InvalidEOFTokenXmpMetadata -> XmpMetadataErrorNoXRef, Date, ActionAlreadyPresent, MissingEndStream, InvalidTrailerSize, SignatureError, NotCompiled, InvalidTrailerSize, DestinationAlreadyPresent, OutlineItemAlreadyPresent, NotLoadedForUpdate, CannotEncryptedForUpdate, InvalidHexString, InvalidStreamLength, InvalidXRefTypePdfDocument:AttachFile(), GetAttachment(): Use GetNames().GetNameTree<PdfEmbeddedFiles>() or similar methods and use that instanceAddNamedDestination(): Use GetNames().GetTree<PdfDestinations>() or similar methods and use that instancePdfName: Removed operator<, std::hash overload. Just use new PdfNameMap, PdfNameHashMap, or use PdfNameInequality, PdfNameEquality and PdfNameHashing to create your new data structurePdfNameComparator: Renamed to PdfNameInequalityPdfDictionaryMap: Renamed to PdfNameMapPdfResources: Moved all string resource type functions to the PdfResourceOperations interface and make all the implementations private. Cast PdfResources instances to this PdfResourceOperations interface if you want to use the now reserved generic functionsPdfXObject, PdfFont: Removed GetIdentifier(), the identifiers are now generated when inserted to PdfResourcesPdfXObjet:SetMatrix(): Removed and moved it to PdfXObjectForm (specification tells it doesn't belong to other XObject)PdfGraphicsStateWrapper:SetFillColor() -> SetNonStrokingColor()SetFillColorSpace() -> SetNonStrokingColorSpace()SetStrokeColor() -> SetStrokingColor()SetStrokeColorSpace() -> SetStrokingColorSpace()SetCurrentMatrix() -> ConcatenateTransformationMatrix()PdfPage:GetRectRaw() now returns Corners instead of RectSetRectRaw() now takes Corners instead of Rectrawrect parameter from CreateField(), use SetRectRaw after creation if you need itrawrect parameter from CreateAnnotation(), use SetRectRaw after creation if you need itMoveAt() -> MoveTo()SetPageWidth(), SetPageHeight(). Use SetRect(), SetMediaBox(), SetCropBox(), etc. insteadSetICCProfile(), SetICCProfile(): create a PdfColorSpaceFilterICCBased and set it through PdfGraphicsStateWrapper::SetNonStrokingColorSpaceGetResources(): Now it returns a reference instead (reflecting in the specification resources is required for pages)MustGetResources(): Removed, use the reference returning GetResources() insteadHasRotation() -> TryGetRotationRadians()GetRotationRaw() and introduced TryGetRotationRaw() or PdfGraphicsStateWrapper::SetStrokingColorSpacePdfColorSpaceFilter: Make GetExportObject protected (no public substitute provided)FileStreamDevice doesn't inherit StandardStreamDevice anymorePdfString:GetString() and GetRawData() now returns std::string_viewPdfStringState renamed to PdfStringCharset, PdfString::GetState() renamed to PdfString::GetCharset() and added PdfString::IsStringEvaluated()PdfName: GetString() and GetRawData() now returns std::string_viewPdfMemDocument:LoadFromDevice() -> Load()AddPdfExtension, HasPdfExtension, RemovePdfExtension, GetPdfExtensions to PdfDocumentAddPdfExtension to PushPdfExtensionPdfAppearanceState: Renamed to PdfAppearanceStreamPdfMetadata:GetTitle(), GetAuthor(), GetSubject(), GetKeywordsRaw(), GetCreator(), GetProducer() now return nullable<const PdfString&> insteadGetCreationDate(), GetModifyDate() now return nullable<const PdfDate&> insteadGetTrapped() now returns nullable<bool> insteadSetTrapped() now takes nullable<bool> insteadGetTrappedRaw(): removed, you can still access PdfInfo::GetTrapped() for a raw version from /InfotrySyncXMP from all functions setting values. Manually call new TrySyncXMPMetadata insteadEnsureXMPMetadata, use SyncXMPMetadata insteadoptional/PdfNames.h and moved all known PdfName::Key... names therePdfEncrypt:GenerateEncryptionKey renamed to EnsureEncryptionInitialized and takes PdfEncryptContxt as an argumentAuthenticate, EncryptTo, DecryptTo, CreateEncryptionInputStream, CreateEncryptionOutputStream now take PdfEncryptContxt as an argumentPdfIndirectObjectList:SetStreamFactory is now private, it's supposed to be used only by private PdfImmediateWriterReplaceObject: Removed, it was added during pdfmm times when there was no better way to rewrite object streams without temporary objectsSetCanReuseObjectNumbers, GetCanReuseObjectNumbers: Removed, the default is true ans it's untested with false. Reusing object numbers is a standard PDF feature and it's better to fix bugs in that part (if any) than allowing to mess with internal indirect object numbering in the public APIRemoveObject(), CreateStream(), Attach() Detach, Clear(),BeginAppendStream(),EndAppendStream(), TryIncrementObjectCount(): Removed from the public API: They have always been for inner use and dangerous to call for the user. For object removal we now rely on garbage collectionObjectListComparator to PdfObjectInequality and moved it to PoDoFo namespacePdfExtGState:PdfDocument::CreateExtGState(definition)PdfExtGStateDefinition instancePdfExtGStateDefinition::NonStrokingAlphaPdfExtGStateDefinition::StrokingAlphaPdfExtGStateDefinition::OverprintControlPdfExtGStateDefinition::NonZeroOverprintModeSetFrequency(): Removed, for now. Needs a more extensive HalfTone dictionary supportPdfStreamedObjectStream: Removed from public API, it's an internal implementation detailPdfXRefEntry,PdfXRefEntries, PdfParserObject, PdfXRefStreamParserObject: Removed from public API, they are internal implementation detailsPdfParser: Taken out of the public API, moved GetMaxObjectCount/SetMaxObjectCount to PdfCommonPdfEncrypt:PdfEncryptAlgorithm::AESV3 -> PdfEncryptAlgorithm::AESV3R5SetEnabledEncryptionAlgorithms(): Disabling algorithms is not supported anymoreCreateFromEncrypt(): Internal usage onlyGetUserPassword(), GetOwnerPassword(): sensitive content, one shouldn't be able to retrieve again after setting;PdfAESV3Revision: Internal usage onlyPdfEncryptSHABase: Not neededPdfEncryptAESBase, PdfEncryptRC4Base: Implementation details, moved to composition instead of multiple inheritancePdfEncryptRC4, PdfEncryptAESV2, PdfEncryptAESV3 are now finalPdfEncryptRC4, PdfEncryptAESV2, PdfEncryptAESV3 public constructors: Implementation details, instances are not supposed to be created by API usersPdfEncryptMD5Base: Removed GetMD5Binary, GetMD5String: They are not supposed to be part of a PDF libraryPdfWriter,PdfImmediateWriter: Removed from public API, they were an implementation detailPdfFontManager::GetOrCreateFont(face), PdfFontMetricsFreetype::CreateFromFace(face), PdfFontMetrics::TryGetOrLoadFace(face), PdfFontMetrics::GetOrLoadFace: removed, exposing methods with FT_Face type may be dangerous in a public API because of possible mismatch of FreeType library version used by the API consumer and the version used in the PoDoFo compilationFreeTypeFacePtr: Removed, it was just used in the implementationPdfCMapEncoding::CreateFromObject to PdfEncodingMapFactory::ParseCMapEncodingPdfNameTree:PdfNameTreesPdfNameTreeOperations and make mutable functions private. Cast to that type if you still want to use themToDictionary now takes std::map<PdfString, PdfObject> as inputHasValue -> renamed to HasKeyPdfColorSpace -> PdfColorSpaceType, PdfColorSpace is now a doc element.PdfColor now it's used just to represent GrayScale, RGB, CMYK colors. Now PdfColorRaw is used to supply color components for other color spacesPdfCanvas:GetRectRaw() now returns Corners instead of RectGetStreamForAppending() -> GetOrCreateContentsStream()GetFromResources: just use GetResourcesHasRotation() -> TryGetRotationRadians()PdfContents: Reset() is now parameterless. It was created to replace the stream. To achieve the same one can do GetStreamForAppending() and use move semantics on the streamPdfContents: Rename GetStreamForAppending() -> CreateStreamForAppending()PdfParserObject::HasStreamToParse() Make it protected virtual in PdfObject (it's unreliable to access it publicly)PdfFontMetricsFreetype::FromBuffer()PdfFontMetricsFreetype::FromMetrics() private (it's really an internal method)PdfFontTrueTypeSubset: it's an implementation detail and not to be exposed in the public APIPdfFilespec:PdfDocument::CreateFilespec()/UF entry is setPdfDestination:PdfDocument::CreateDestination()PdfAction:PdfActionURI, PdfActionJavascript and so on classes. Moved URI, script accessors to respective classesPdfDocument::CreateAction()PdfOutlineItem, PdfOutlines:GetTextColorRed(), GetTextColorGreen(), GetTextColorBlue(), added GetTextColor() that returns PdfColorSetTextColor() now takes a PdfColornullable<PdfDestination&>nullable<PdfAction&>InsertChild is now private onlyPdfAnnotation:GetRectRaw() now returns Corners instead of RectSetRectRaw() now takes Corners instead of RectPdfAnnotationActionBase:nullable<PdfAction&>PdfAnnotationLink:nullable<PdfDestination&>PdfAnnotationFileAttachment:nullable<PdfFilespec&>PdfRef, PdfXRefStream: Make the constructor internal, PdfXRefStream class finalPdfSignature:SetAppearanceStream. Use GetWidget().SetAppearanceStream() (plus optional GetWidget().GetOrCreateAppearanceCharacteristics(), if you needed that) insteadPrepareForSigning(): Make it internalPdfACtion hierarchy: make all hierarchy constructors internals and leave classes finalPdfField hierarchy: make all hierarchy leave classes finalPdfDataProvider, PdfDataContainer: Make the classes internalPdfEncodingMapOneByte renamed to PdfEncodingMapSimplePdfEncodingMap, PdfEncodingMapSimple, PdfBuiltInEncoding, PdfPredefinedEncoding, PdfEncodingMapBase: make the constructors internalPdfEncodingMap:IsBuiltinEncoding. No replacement, it just told if the font was built-in in Type1 font program. For now it's not expected to be usefulTryGetCodePoints(), TryGetNextCodePoints now takes CodePointSpan instead of vector<codepoint>TryGetExportObject: Make it private, no public substitute providedPdfCharCodeMap: TryGetCodePoints() now takes CodePointSpan instead of vector<codepoint>PdfEncoding: TryScan now takes CodePointSpan instead of vector<codepoint>PdfExtension: Make the constructor internal and class finalPdfFilter: Make the constructor internalPdfFilterFactory: Make class internal use onlyPdfFont, PdfFontSimple, PdfFontCID, PdfFontObject: Make the constructor internalPdfFontType1, PdfFontType3, PdfFontTrueType, PdfFontCIDTrueType, PdfFontCIDType1: Make the classes finalPdfObjectInputStream, PdfObjectOutputStream: Make the classes finalPdfObjectStreamParser: Made the class internal use onlyPdfWinAnsiEncoding: Made the class finalPdfXObjectPostScript: Made the class finalPdfContents: Made the constructor internal and the class internalPdfCatalog: Made the constructor internalPdfEncoding: Made the class final, maked ExportToFont() internalPdfParser::TakeEncrypt() -> PdfParser::GetEncrypt() which now returns std::shared_ptr. This change was needed to address a vulnerability concern in #70. Although public, This method is considered to be infrastructural and not called often outside of PoDofo;PdfPageTreeCache was removed. Also this class was infrastructural and probably not used outside of PoDofo.The following is an incomplete list of 0.9.8 -> 0.10.0 API modifications. Feel free to suggest improvements in the ML or in a GitHub issue.
pdf_int* types and moved to standard int*_t types;pdf_long and all usages converted to either size_t and ssize_t;PdfVecObjects -> PdfIndirectObjectListPdfFontCache -> PdfFontManagerPdfNamesTree -> PdfNameTreePdfPagesTree -> PdfPageCollectionPdfInputDevice -> InputDevicePdfOutputDevice -> OutputDevicePdfInputStream -> InputStreamPdfOutputStream -> OutputStreamInputDevice/OutputDevice into StreamDevicePdfDocument::GetNameTree() -> GetNames()PdfDocument::GetPage()/PdfDocument::CreatePage() removed and moved to PdfPageCollectionPdfDocument::CreateFont(), PdfDocument::CreateFontSubset moved to PdfFontManager::SearchFonts(), PdfFontManager::GetStandard14Font(), PdfFontManager::GetOrCreateFont(), PdfDocument::GetOrCreateFontFromBuffer()PdfDocument::CreateDuplicateFontType1()PdfMemDocument::Write() -> PdfMemDocument::Save()PdfArray::FindAt() now returns referencePdfDocument::GetFontCache() -> PdfDocument::GetFonts()PdfPage::GetAnnot() and annotations methods are removed. Use PdfPage::GetAnnots() insteadPdfWriteFlags are now internal use, use PdfSaveOptions insteadPdfXObject, is now an abstract class. Refer to PdfXObjectFormPdfXObjectForm, use PdfDocument::CreateXObjectForm()PdfAnnotation, is now an abstract class. Refer to the full new hierarchy (PdfAnnotationWidget, PdfAnnotationLink, ...)PdfSignatureField -> PdfSignaturePdfTextField -> PdfTextBoxPdfListField -> PdfChoiceFieldPdfImage::GetFilteredCopy() -> PdfImage::GetDecodedCopy()PdfObject::GetIndirectKey() like methods removed. Use PdfObject::TryGetDictionary(dict) and PdfDictionary methods insteadPdfSignOutputDevice removed, use PoDoFo::SignDocument() insteadPdfDate::PdfDate() now creates an epoch date. Use PdfDate::LocalNow() PdfDate::UtcNow(). PdfDate::PdfDate(str) is moved to PdfDate::Parse(str)PdfFontMetrics::GetStringWidth() -> PdfFont::GetStringLength(state), PdfFontMetrics::GetGlyphWidth() -> PdfFont::GetCharLength() with state filled with FontSizePdfFont::SetFontSize() removed. See functions in PdfFont that accepts PdfTextState. PdfFont::SetBold(), PdfFont::SetItalic() removed as they were no sense. Font style now is read-only and can be read from PdfFontMetrics::GetFontStyle()PdfTable: Removed as providing formatting features that are too high level for the scope of PoDoFoPdfDocument::Clear(): Removed, reintroduced in >0.10 as PdfDocument::Reset()PdfDocument::InsertExistingPageAt: Moved and renamed to PdfPageCollection::InsertDocumentPageAtPdfDocument::Append: Moved, renamed and improved to PdfPageCollection::AppendDocumentPagesPdfPage::GetField(), PdfPage::GetFieldCount(): Removed, iterate annotations instead for now.
1.8.14