PoDoFo API migration guide
Francesco Pretto edited this page Apr 28, 2024
·
19 revisions
- Removed
PdfFontMetricsFreetype::FromBuffer()
- Make
PdfFontMetricsFreetype::FromMetrics()
private (it's really an internal method) - Removed
PdfFontTrueTypeSubset
: it's an implementation detail and not to be exposed in the public API -
PdfFilespec
:- Removed public constructors, moved construction to
PdfDocument::CreateFilespec()
- Moved setters to public methods instead of construction parameters. By default now just the
/UF
entry is set
- Removed public constructors, moved construction to
-
PdfDestination
:- Removed public constructors, moved construction to
PdfDocument::CreateDestination()
- Removed public constructors, moved construction to
-
PdfAction
:- Reworked hierarchy, create
PdfActionURI
,PdfActionJavascript
and so on classes. Moved URI, script accessors to respective classes - Removed public constructors, moved construction to
PdfDocument::CreateAction()
- Reworked hierarchy, create
-
PdfOutlineItem
,PdfOutlines
:- Removed public constructors, they are now construct privately only
- Removed
GetTextColorRed()
,GetTextColorGreen()
,GetTextColorBlue()
, addedGetTextColor()
that returnsPdfColor
-
SetTextColor()
now takes aPdfColor
- Setting/Getting destination now uses
nullable<PdfDestination&>
- Setting/Getting action now uses
nullable<PdfAction&>
-
InsertChild
is now private only
-
PdfAnnotationActionBase
:- Setting/Getting action now uses
nullable<PdfAction&>
- Setting/Getting action now uses
-
PdfAnnotationLink
:- Setting/Getting destination now uses
nullable<PdfDestination&>
- Setting/Getting destination now uses
-
PdfAnnotationFileAttachment
:- Setting/Getting filespec now uses
nullable<PdfFilespec&>
- Setting/Getting filespec now uses
-
PdfRef
,PdfXRefStream
: Make the constructor internal,PdfXRefStream
class final -
PdfSignature::PrepareForSigning()
: Make it internal -
PdfACtion
hierarchy: make all hierarchy constructors internals and leave classes final -
PdfField
hierarchy: make all hierarchy leave classes final -
PdfDataProvider
,PdfDataContainer
: Make the classes internal -
PdfEncodingMap
,PdfEncodingMapOneByte
,PdfBuiltInEncoding
,PdfPredefinedEncoding
,PdfEncodingMapBase
: make the constructors internal -
PdfExtension
: Make the constructor internal and class final -
PdfFilter
: Make the constructor internal -
PdfFilterFactory
: Make class internal use only -
PdfFont
,PdfFontSimple
,PdfFontCID
,PdfFontObject
: Make the constructor internal -
PdfFontType1
,PdfFontType3
,PdfFontTrueType
,PdfFontCIDTrueType
,PdfFontCIDType1
: Make the classes final -
PdfObjectInputStream
,PdfObjectOutputStream
: Make the classes final -
PdfObjectStreamParser
: Made the class internal use only -
PdfWinAnsiEncoding
: Made the class final -
PdfXObjectPostScript
: Made the class final -
PdfContents
: Made the constructor internal and the class internal -
PdfCatalog
: Made the constructor internal -
PdfEncoding
: Made the class final, makedExportToFont()
internal
-
PdfParser::TakeEncrypt()
->PdfParser::GetEncrypt()
which now returnsstd::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.
- Removed all
pdf_int*
types and moved to standardint*_t
types; - Removed
pdf_long
and all usages converted to eithersize_t
andssize_t
; - Renamed
PdfVecObjects
->PdfIndirectObjectList
- Renamed
PdfFontCache
->PdfFontManager
- Renamed
PdfNamesTree
->PdfNameTree
- Renamed
PdfPagesTree
->PdfPageCollection
- Renamed
PdfInputDevice
->InputDevice
- Renamed
PdfOutputDevice
->OutputDevice
- Renamed
PdfInputStream
->InputStream
- Renamed
PdfOutputStream
->OutputStream
- Merged
InputDevice
/OutputDevice
intoStreamDevice
- Renamed
PdfDocument::GetNameTree()
->GetNames()
-
PdfDocument::GetPage()
/PdfDocument::CreatePage()
removed and moved toPdfPageCollection
-
PdfDocument::CreateFont()
,PdfDocument::CreateFontSubset
moved toPdfFontManager::SearchFonts()
,PdfFontManager::GetStandard14Font()
,PdfFontManager::GetOrCreateFont()
,PdfDocument::GetOrCreateFontFromBuffer()
- Removed
PdfDocument::CreateDuplicateFontType1()
-
PdfArray::FindAt()
now returns reference -
PdfDocument::GetFontCache()
->PdfDocument::GetFonts()
-
PdfPage::GetAnnot()
and annotations methods are removed. UsePdfPage::GetAnnots()
instead -
PdfWriteFlags
are now internal use, usePdfSaveOptions
instead -
PdfXObject
, is now an abstract class. Refer toPdfXObjectForm
- To create a
PdfXObjectForm
, use PdfDocument::CreateXObjectForm()` -
PdfAnnotation
, is now an abstract class. Refer to the full new hierarchy (PdfAnnotationWidget
,PdfAnnotationLink
, ...) - Renamed
PdfSignatureField
->PdfSignature
- Renamed
PdfTextField
->PdfTextBox
- Renamed
PdfListField
->PdfChoiceField
- Renamed
PdfImage::GetFilteredCopy()
->PdfImage::GetDecodedCopy()
-
PdfObject::GetIndirectKey()
like methods removed. UsePdfObject::TryGetDictionary(dict)
andPdfDictionary
methods instead -
PdfSignOutputDevice
removed, usePoDoFo::SignDocument()
instead -
PdfDate::PdfDate()
now creates an epoch date. UsePdfDate::LocalNow()
PdfDate::UtcNow()
.PdfDate::PdfDate(str)
is moved toPdfDate::Parse(str)
-
PdfFontMetrics::GetStringWidth()
->PdfFont::GetStringLength(state)
,PdfFontMetrics::GetGlyphWidth()
->PdfFont::GetCharLength()
with state filled withFontSize
-
PdfFont::SetFontSize()
removed. See functions inPdfFont
that acceptsPdfTextState
.PdfFont::SetBold()
,PdfFont::SetItalic()
removed as they were no sense. Font style now is read-only and can be read fromPdfFontMetrics::GetFontStyle()
-
PdfTable
: Removed as providing formatting features that are too high level for the scope of PoDoFo -
PdfDocument::Clear()
: Removed, reintroduced in >0.10 asPdfDocument::Reset()
-
PdfPage::GetField()
,PdfPage::GetFieldCount()
: Removed, iterate annotations instead for now.