0
私はPDFにテキストをいくつか集中させようとしています。私はjsPDFを使用しており、この解決策を見つけました。TypeError: 'widths'は未定義ですが、jsPDFでテキストを中央に配置しようとしています
Is there any way to center text with jsPDF?
私の問題は、これを実行しているとき、私はエラーを取得しています。
Object {
PostScriptName: "Helvetica"
encoding: "StandardEncoding"
fontName: "helvetica"
fontStyle: "normal"
id: "F1"
metadata: {}
メタデータオブジェクトは何も持っていない、まだ機能は、Unicodeを取得しようとしている:
split_text_to_size.js:47 Uncaught (in promise) TypeError: Cannot read property 'widths' of undefined(…)
API.getCharWidthsArray @ split_text_to_size.js:47
API.getStringUnitWidth @ split_text_to_size.js:95
<my function>
機能getCharWidthsArray()このオブジェクトを返すthis.internal.getFont()を使用しています。そのオブジェクトの幅。回避策はありますか?
ええ、問題を解決できました。ありがとう – Nickelmatt