URL から PDF ファイルを取得し、ストリームを Base 64 にエンコードして、XML ファイルのフィールド内で文字列をサード パーティに送信することはできますが、PDF ファイル デコードを開こうとすると、次の問題が発生します。
埋め込みフォント 'ArialMT,Bold" を抽出できません。一部の文字が正しく表示または印刷されない場合があります。
以下は、SAP PI 7.1 での Java マッピングのコードです。
urlStr = "Insert here your url";
StringBuffer data = new StringBuffer();
URL url = new URL(urlStr);
URLConnection conn = url.openConnection ();
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuffer sb = new StringBuffer();
String line;
String carriagereturn = System.getProperty("line.separator");
while ((line = rd.readLine()) != null)
{
trace.addWarning(line);
sb.append(line);
sb.append(carriagereturn);
}
rd.close();
result = sb.toString();
} catch (Exception e){
trace.addWarning(e.toString());
}
return org.apache.commons.codec.binary.Base64.encodeBase64String(result.getBytes());
InputStreamReader
文字の著作権のために、実行時にフォントを取得できないことを読みました。本当ですか?
後で iText ライブラリなどを使用してフォントを埋め込む可能性はありますか?