Hi,
I’m encountering an issue when using Spire.Office to load a DOC file and convert it into a PDF. The conversion process fails when the DOC file contains a text box, resulting in the following exception:
at com.spire.office.packages.sprjlna.spr〨▏—(nhg:515)
at com.spire.office.packages.sprjlna.<init>(nhg:57)
at com.spire.office.packages.sprjlna.<init>(nhg:134)
at com.spire.office.packages.sprjfda.spr╺┎—(Unknown Source)
at com.spire.office.packages.sprxhca.<init>(Unknown Source)
at com.spire.office.packages.sprpbca.spr⁂┄—(Unknown Source)
at com.spire.office.packages.sprweca.spr⑊┃—(Unknown Source)
at com.spire.office.packages.spradca.spr▌┃—(Unknown Source)
at com.spire.office.packages.sprseca.spr⅚┃—(Unknown Source)
at com.spire.office.packages.sprbyba.spr╀┵(Unknown Source)
at com.spire.office.packages.sprnuba.spr┕╇(Unknown Source)
at com.spire.office.packages.sprlok.spr┕╇(Unknown Source)
at com.spire.office.packages.spryrba.spr┕╇(Unknown Source)
at com.spire.office.packages.sprlok.spr┕╇(Unknown Source)
at com.spire.office.packages.sprbsba.spr┕╇(Unknown Source)
at com.spire.office.packages.sprlok.spr┕╇(Unknown Source)
at com.spire.office.packages.sprbsba.spr┕╇(Unknown Source)
at com.spire.office.packages.sprlok.spr┕╇(Unknown Source)
at com.spire.office.packages.sprgok.spr┕╇(Unknown Source)
at com.spire.office.packages.sprbyba.spr▩┵(Unknown Source)
at com.spire.office.packages.sprgssa.spr≋⌦–(Unknown Source)
at com.spire.office.packages.sprrtsa.spr┟⌦–(Unknown Source)
at com.spire.office.packages.sprrtsa.spr–⌦–(Unknown Source)
at com.spire.office.packages.sprrtsa.spr–※(Unknown Source)
at com.spire.doc.Document.spr㈮⃞│–(Unknown Source)
at com.spire.doc.Document.spr⑇┃–(Unknown Source)
at com.spire.doc.Document.spr‰‼(Unknown Source)
at com.spire.doc.Document.spr┌│–(Unknown Source)
at com.spire.doc.Document.saveToStream(Unknown Source)
Here is the Java code snippet that I use
doc = new Document();
doc.loadFromStream(inputFile, FileFormat.Auto);
byte[] dataStream = null;
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
doc.saveToStream(out, FileFormat.PDF);
out.close();
dataStream = out.toByteArray();
}
I attached sample files for two doc files one with the issue and another valid one.
Could you please assist with resolving this issue? Any guidance or workaround would be greatly appreciated.