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)
3030 {
3131 info . Author = "Gerard Gunnewijk" ;
3232 info . Title = "Example 1" ;
33+ info . ExtraInfo . Add ( "CutContourProgramId" , "cloud-shape" ) ;
3334 } )
3435 // Test placement using rectangle
3536 . AddPage ( page =>
Original file line number Diff line number Diff line change 11using Synercoding . FileFormats . Pdf . LowLevel ;
22using Synercoding . FileFormats . Pdf . LowLevel . Extensions ;
33using System ;
4+ using System . Collections . Generic ;
45
56namespace Synercoding . FileFormats . Pdf
67{
@@ -59,6 +60,11 @@ internal DocumentInformation(PdfReference id)
5960 /// <inheritdoc />
6061 public PdfReference Reference { get ; }
6162
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+
6268 internal uint WriteToStream ( PdfStream stream )
6369 {
6470 if ( _isWritten )
@@ -84,6 +90,10 @@ internal uint WriteToStream(PdfStream stream)
8490 dictionary . Write ( PdfName . Get ( "CreationDate" ) , _toPdfDate ( did . CreationDate . Value ) ) ;
8591 if ( did . ModDate != null )
8692 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 ) ) ;
8797 } ) ;
8898
8999 _isWritten = true ;
You can’t perform that action at this time.
0 commit comments