Skip to content

Commit

Permalink
Resolve #513: For attachments if file name is not PdfDocEncoding then…
Browse files Browse the repository at this point in the history
… sets unicode file name True.
  • Loading branch information
Maxim Smirnov authored and asturio committed May 24, 2021
1 parent 08ff6a8 commit 26f2c81
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePat
PdfFileSpecification fs = new PdfFileSpecification();
fs.writer = writer;
fs.put(PdfName.F, new PdfString(fileDisplay));
fs.setUnicodeFileName(fileDisplay, false);
fs.setUnicodeFileName(fileDisplay, !PdfEncodings.isPdfDocEncoding(fileDisplay));
PdfEFStream stream;
InputStream in = null;
PdfIndirectReference ref;
Expand Down Expand Up @@ -243,7 +243,7 @@ public static PdfFileSpecification fileExtern(PdfWriter writer, String filePath)
PdfFileSpecification fs = new PdfFileSpecification();
fs.writer = writer;
fs.put(PdfName.F, new PdfString(filePath));
fs.setUnicodeFileName(filePath, false);
fs.setUnicodeFileName(filePath, !PdfEncodings.isPdfDocEncoding(filePath));
return fs;
}

Expand Down

0 comments on commit 26f2c81

Please sign in to comment.