Closed kartikeyporwal closed 2 years ago
That's strange, why is that doc file not supported as a TextDocument? Is it not a word document?
Yes, I later found out that it was not the original word format but com.sun.star.text.WebDocument
that is a html type of format with .doc
extension.
I see. I'll see if I can find some example of that and test it, it's possible that adding com.sun.star.text.WebDocument isn't a problem.
I can't find any examples of this document format. However, the export filter list does list a "com.sun.star.text.WebDocument" to "pdf_Portable_Document_Format" output filter, so it should be possible to convert it.
I think the changes made in the next release will solve this issue.
1.2 released
Hi, thanks for developing and sharing this project.
I recently came across an issue while converting a
.doc
file to a.pdf
file (unfortunately, I can't share doc file due to IP reasons).The error was:
RuntimeError: The input document is of an unknown document type. This is probably a bug.
Though I'm not familiar with the OpenOffice APIs, when I checked
document.SupportedServiceNames
for that particular file, the result is('com.sun.star.document.OfficeDocument', 'com.sun.star.text.GenericTextDocument', 'com.sun.star.text.WebDocument')
. Neither of these are listed inDocTypes
. When I addedcom.sun.star.document.OfficeDocument
inDocTypes
, the new error statesRuntimeError: Could not find an export filter from com.sun.star.document.OfficeDocument to pdf_Portable_Document_Format
.Now when I checked the
DocumentService
ofexport_filter
, there is no entry forcom.sun.star.document.OfficeDocument
, andcom.sun.star.text.GenericTextDocument
butcom.sun.star.text.WebDocument
, so I replacedcom.sun.star.document.OfficeDocument
inDocTypes
withcom.sun.star.text.WebDocument
but later foundcom.sun.star.text.WebDocument
is deprecated.Fortunately, It worked.
But my concern is, can this project be ported to support any kind of docs (
.doc
,.docx
,.odt
,.rtf
, etc.) conversion to pdf? Though the changes I made worked for the documents I have but I am afraid ascom.sun.star.text.WebDocument
is deprecated.doc
file which can fail during pdf cnversion.I guess some change in
export_filters
query might includeDocumentService
for otherDocTypes
.Thanks!