如何在pdfbox中修复FileNotFoundException pdbox.cache EROFS

时间:2019-05-13 14:35:03

标签: java android apache pdfbox

我在我的android studio项目中使用了dhorion的boxable。如标题所述,我得到了这个错误。

BaseTable table = new BaseTable(yPosition, yStartNewPage, bottomMargin, tableWidth, margin, mainDocument, myPage, true, true);
PDPage myPage = new PDPage(PDRectangle.A4);
DataTable t = new DataTable(table, myPage); //this line throw the exception
java.io.FileNotFoundException: .pdfbox.cache: open failed: EROFS (Read-only file system)
    at libcore.io.IoBridge.open(IoBridge.java:456)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
    at java.io.FileWriter.<init>(FileWriter.java:42)
    at org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.saveDiskCache(FileSystemFontProvider.java:288)
    at org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.<init>(FileSystemFontProvider.java:226)
    at org.apache.pdfbox.pdmodel.font.FontMapperImpl$DefaultFontProvider.<clinit>(FontMapperImpl.java:130)
    at org.apache.pdfbox.pdmodel.font.FontMapperImpl$DefaultFontProvider.access$100(FontMapperImpl.java:128)
    at org.apache.pdfbox.pdmodel.font.FontMapperImpl.getProvider(FontMapperImpl.java:149)
    at org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFont(FontMapperImpl.java:413)
    at org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFontBoxFont(FontMapperImpl.java:376)
    at org.apache.pdfbox.pdmodel.font.FontMapperImpl.getFontBoxFont(FontMapperImpl.java:350)
    at org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:140)
    at org.apache.pdfbox.pdmodel.font.PDType1Font.<clinit>(PDType1Font.java:78)
    at be.quodlibet.boxable.Cell.<init>(Cell.java:24)
    at be.quodlibet.boxable.Row.createCell(Row.java:134)
    at be.quodlibet.boxable.datatable.DataTable.<init>(DataTable.java:60)

有解决方案吗?

0 个答案:

没有答案