|
@@ -272,6 +272,17 @@ type
|
|
property Value: AnsiString read FValue;
|
|
property Value: AnsiString read FValue;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TPDFRawHexString }
|
|
|
|
+
|
|
|
|
+ TPDFRawHexString = class(TPDFDocumentObject)
|
|
|
|
+ private
|
|
|
|
+ FValue: String;
|
|
|
|
+ protected
|
|
|
|
+ procedure Write(const AStream: TStream); override;
|
|
|
|
+ public
|
|
|
|
+ constructor Create(Const ADocument : TPDFDocument; const AValue: String); overload;
|
|
|
|
+ property Value: String read FValue;
|
|
|
|
+ end;
|
|
|
|
|
|
TPDFUTF8String = class(TPDFAbstractString)
|
|
TPDFUTF8String = class(TPDFAbstractString)
|
|
private
|
|
private
|
|
@@ -1006,6 +1017,7 @@ type
|
|
function CreateContentsEntry(const APageNum: integer): integer;virtual;
|
|
function CreateContentsEntry(const APageNum: integer): integer;virtual;
|
|
function CreateCatalogEntry: integer;virtual;
|
|
function CreateCatalogEntry: integer;virtual;
|
|
procedure CreateInfoEntry;virtual;
|
|
procedure CreateInfoEntry;virtual;
|
|
|
|
+ procedure CreateTrailerID;virtual;
|
|
procedure CreatePreferencesEntry;virtual;
|
|
procedure CreatePreferencesEntry;virtual;
|
|
function CreatePagesEntry(Parent: integer): integer;virtual;
|
|
function CreatePagesEntry(Parent: integer): integer;virtual;
|
|
function CreatePageEntry(Parent, PageNum: integer): integer;virtual;
|
|
function CreatePageEntry(Parent, PageNum: integer): integer;virtual;
|
|
@@ -1148,6 +1160,7 @@ implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
math,
|
|
math,
|
|
|
|
+ md5,
|
|
fpttf;
|
|
fpttf;
|
|
|
|
|
|
|
|
|
|
@@ -1330,6 +1343,19 @@ begin
|
|
Result := APixels / cDefaultDPI;
|
|
Result := APixels / cDefaultDPI;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+{ TPDFRawHexString }
|
|
|
|
+
|
|
|
|
+procedure TPDFRawHexString.Write(const AStream: TStream);
|
|
|
|
+begin
|
|
|
|
+ WriteString('<'+FValue+'>', AStream);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+constructor TPDFRawHexString.Create(const ADocument: TPDFDocument; const AValue: String);
|
|
|
|
+begin
|
|
|
|
+ inherited Create(ADocument);
|
|
|
|
+ FValue := AValue;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TPDFMatrix }
|
|
{ TPDFMatrix }
|
|
|
|
|
|
function TPDFMatrix.Transform(APoint: TPDFCoord): TPDFCoord;
|
|
function TPDFMatrix.Transform(APoint: TPDFCoord): TPDFCoord;
|
|
@@ -4386,6 +4412,20 @@ begin
|
|
IDict.AddString('CreationDate',DateToPdfDate(Infos.CreationDate));
|
|
IDict.AddString('CreationDate',DateToPdfDate(Infos.CreationDate));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TPDFDocument.CreateTrailerID;
|
|
|
|
+var
|
|
|
|
+ s: string;
|
|
|
|
+ ID: TPDFArray;
|
|
|
|
+begin
|
|
|
|
+ s := DateToPdfDate(Now) + IntToStr(GLobalXRefCount) +
|
|
|
|
+ Infos.Title + Infos.Author + Infos.ApplicationName + Infos.Producer + DateToPdfDate(Infos.CreationDate);
|
|
|
|
+ s := MD5Print(MD5String(s));
|
|
|
|
+ ID := CreateArray;
|
|
|
|
+ ID.AddItem(TPDFRawHexString.Create(Self, s));
|
|
|
|
+ ID.AddItem(TPDFRawHexString.Create(Self, s));
|
|
|
|
+ Trailer.AddElement('ID', ID);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TPDFDocument.CreatePreferencesEntry;
|
|
procedure TPDFDocument.CreatePreferencesEntry;
|
|
|
|
|
|
var
|
|
var
|
|
@@ -4918,6 +4958,7 @@ begin
|
|
CreateTrailer;
|
|
CreateTrailer;
|
|
FCatalogue:=CreateCatalogEntry;
|
|
FCatalogue:=CreateCatalogEntry;
|
|
CreateInfoEntry;
|
|
CreateInfoEntry;
|
|
|
|
+ CreateTrailerID;
|
|
CreatePreferencesEntry;
|
|
CreatePreferencesEntry;
|
|
if (FontDirectory = '') then
|
|
if (FontDirectory = '') then
|
|
FontDirectory:=ExtractFilePath(ParamStr(0));
|
|
FontDirectory:=ExtractFilePath(ParamStr(0));
|