getProfile().verifyPDFVersion();
- byte[] pdf = ("%PDF-" + getPDFVersionString() + "\n").getBytes();
+ byte[] pdf = encode("%PDF-" + getPDFVersionString() + "\n");
stream.write(pdf);
this.position += pdf.length;
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
DateFormat df = new SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS");
- digest.update(df.format(new Date()).getBytes());
+ digest.update(encode(df.format(new Date())));
//Ignoring the filename here for simplicity even though it's recommended by the PDF spec
- digest.update(String.valueOf(this.position).getBytes());
+ digest.update(encode(String.valueOf(this.position)));
digest.update(getInfo().toPDF());
byte[] res = digest.digest();
String s = PDFText.toHex(res);
*/
public void add(String s) {
try {
- data.getOutputStream().write(s.getBytes());
+ data.getOutputStream().write(PDFDocument.encode(s));
} catch (IOException ex) {
//TODO throw the exception and catch it elsewhere
ex.printStackTrace();
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="JM" type="fix" fixes-bug="41434" due-to="Martin Kögler">
+ Fix PDF Genaration for non-ASCII compatible locales.
+ </action>
<action context="Code" dev="VH, JM" type="add" importance="high" fixes-bug="36934">
Add support for the collapsing-border model in tables.
</action>