File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
samples/Synercoding.FileFormats.Pdf.ConsoleTester
src/Synercoding.FileFormats.Pdf Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public static void Main(string[] args)
30
30
{
31
31
info . Author = "Gerard Gunnewijk" ;
32
32
info . Title = "Example 1" ;
33
+ info . ExtraInfo . Add ( "CutContourProgramId" , "cloud-shape" ) ;
33
34
} )
34
35
// Test placement using rectangle
35
36
. AddPage ( page =>
Original file line number Diff line number Diff line change 1
1
using Synercoding . FileFormats . Pdf . LowLevel ;
2
2
using Synercoding . FileFormats . Pdf . LowLevel . Extensions ;
3
3
using System ;
4
+ using System . Collections . Generic ;
4
5
5
6
namespace Synercoding . FileFormats . Pdf
6
7
{
@@ -59,6 +60,11 @@ internal DocumentInformation(PdfReference id)
59
60
/// <inheritdoc />
60
61
public PdfReference Reference { get ; }
61
62
63
+ /// <summary>
64
+ /// Extra information that will be added to the PDF meta data
65
+ /// </summary>
66
+ public IDictionary < string , string > ExtraInfo { get ; } = new Dictionary < string , string > ( ) ;
67
+
62
68
internal uint WriteToStream ( PdfStream stream )
63
69
{
64
70
if ( _isWritten )
@@ -84,6 +90,10 @@ internal uint WriteToStream(PdfStream stream)
84
90
dictionary . Write ( PdfName . Get ( "CreationDate" ) , _toPdfDate ( did . CreationDate . Value ) ) ;
85
91
if ( did . ModDate != null )
86
92
dictionary . Write ( PdfName . Get ( "ModDate" ) , _toPdfDate ( did . ModDate . Value ) ) ;
93
+
94
+ if ( did . ExtraInfo . Count != 0 )
95
+ foreach ( var kv in did . ExtraInfo )
96
+ dictionary . Write ( PdfName . Get ( kv . Key ) , _toPdfHexadecimalString ( kv . Value ) ) ;
87
97
} ) ;
88
98
89
99
_isWritten = true ;
You can’t perform that action at this time.
0 commit comments