This repository was archived by the owner on Sep 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -365,22 +365,14 @@ internal override void PrepareForSave()
365
365
{
366
366
PdfDocumentInformation info = Info ;
367
367
368
+ // Set Producer if value is undefined
369
+ if ( info . Elements [ PdfDocumentInformation . Keys . Producer ] == null )
370
+ info . Producer = VersionInfo . Producer ;
371
+
368
372
// Set Creator if value is undefined
369
373
if ( info . Elements [ PdfDocumentInformation . Keys . Creator ] == null )
370
374
info . Creator = VersionInfo . Producer ;
371
375
372
- // Keep original producer if file was imported
373
- string producer = info . Producer ;
374
- if ( producer . Length == 0 )
375
- producer = VersionInfo . Producer ;
376
- else
377
- {
378
- // Prevent endless concatenation if file is edited with PDFsharp more than once
379
- if ( ! producer . StartsWith ( VersionInfo . Title ) )
380
- producer = VersionInfo . Producer + " (Original: " + producer + ")" ;
381
- }
382
- info . Elements . SetString ( PdfDocumentInformation . Keys . Producer , producer ) ;
383
-
384
376
// Prepare used fonts
385
377
if ( this . fontTable != null )
386
378
this . fontTable . PrepareForSave ( ) ;
Original file line number Diff line number Diff line change @@ -102,11 +102,12 @@ public string Creator
102
102
}
103
103
104
104
/// <summary>
105
- /// Gets the producer application (for example, PDFsharp).
105
+ /// Gets or sets the name of the producer application (for example, PDFsharp).
106
106
/// </summary>
107
107
public string Producer
108
108
{
109
109
get { return Elements . GetString ( Keys . Producer ) ; }
110
+ set { Elements . SetString ( Keys . Producer , value ) ; }
110
111
}
111
112
112
113
/// <summary>
You can’t perform that action at this time.
0 commit comments