Plugins for PDF to be installed for Qt
-
There is no plugin needed to use QAxWidget in Qt.
-
@harsha123 said in Plugins for PDF to be installed for Qt:
Like when i run the code to create PDF it is creating error that is because of not having plugins.
But Qt does not create PDFs. You just call an ActiveX object in another program which then creates a PDF. So you must make sure that this program is able to create PDFs. Has nothing to do with Qt.
-
@harsha123 said in Plugins for PDF to be installed for Qt:
Like when i run the code to create PDF it is creating error that is because of not having plugins.
And what "error" is this showing you?
Maybe this error is coming from the Word itself you access via
QAx...
saying it needs something set up in order to convert to PDF, I don't know? In your other threads on this I did ask you to verify you can do the export to PDF from within Word yourself, before you try to do it from QtQAx...
: did you test that? -
when i run in one system it is working , but in other system i ma getting this error
QAxBase::dynamicCallHelper: ExportAsFixedFormat(QVariant,QVariant,QVariant): No such property in [Microsoft Word Document]
Candidates are:
Email
EmbedLinguisticData
EmbedSmartTags
EmbedTrueTypeFonts
Endnotes
EnforceStyle
EnvelopeDonno the reason behind this.
-
@harsha123 said in Plugins for PDF to be installed for Qt:
when i run in one system it is working , but in other system i ma getting this error
You never said before it is working on one system but not on another, that is new (important) information......
One more time: on the "other, non-working" system, have you or have you not tested you can do the PDF export from Word outside of Qt? And, did you try the similar export-to-PDF but from Excel instead on that system?
-
This is for sure not Qt problem since ExportAsFixedFormat is an ActiveX call in Excel and therefore the error message comes from there, not Qt.
-
@Christian-Ehrlicher
The actual error appears to be thatQAxBase::dynamicCallHelper()
is not findingExportAsFixedFormat
as an "exported Automation method" in the installed Word on some particular machine. Why I do not yet know, I'd like to know whether the similar Excel call does or does not work..... -
@harsha123 said in Plugins for PDF to be installed for Qt:
QAxBase::dynamicCallHelper: ExportAsFixedFormat(QVariant,QVariant,QVariant): No such property in [Microsoft Word Document]
Candidates are:
Email
EmbedLinguisticData
EmbedSmartTags
EmbedTrueTypeFontsOK, I've had a quick look at this. If you Google e.g.
Word EmbedTrueTypeFonts
you come to https://docs.microsoft.com/en-us/office/vba/api/word.document.embedtruetypefonts. If you look through the index on the left that is indeed a property. ButExportAsFixedFormat
is a method, at https://docs.microsoft.com/en-us/office/vba/api/word.document.exportasfixedformat. I am unsure whether the error message referring to a "property" has or has not looked for it as a method. You might try with another method from there, such asSave()
orRepaginate()
, to see whether those do work as "methods"? -
So did you actually tried to save a doc in Word 2003 as PDF? Did it work? I would guess not because saving to PDF was added later...
-
@harsha123
Ahhhhhhhhhhhhhhhhhhhhhhhhhh. It really helps if you check and state this in the first place!https://stackoverflow.com/questions/60342174/word-exportasfixedformat claims to have it working in Word 2019. It might be worth a try passing all the same number of parameters as you see in that example code, in case 2019
ExportAsFixedFormat
requires more parameters than before, i don't know.P.S.
Only the first 2 parameters are mandatory. TryExportAsFixedFormat(QVariant,QVariant)
or whatever it is you presently have but omit the third parameter for "OpenAfterExport", just in case that works instead (though I don't think so, but worth a try). -
@harsha123 said in Plugins for PDF to be installed for Qt:
because with 2019 it is working
Do you mean NOT working??
WAIT
one system (non working) it is 2003
OMG. Word 2003 is too old to have
ExportAsFixedFormat
, no wonder!! (And probably does not export to PDF at all; I did ask you to verify that it worked on the failing system just from within Word, forget about Qt?) Why not say that from the outset? Who in the world uses Word 2003 in 2022...? This is your whole issue...... Please supply such relevant information in the first place when you ask a question, this whole thing has been a wild goose chase.....