Conversion of Office Formats to PDF

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Conversion of Office Formats to PDF

Post by Kutusow » Tue Oct 30, 2018 12:30 pm

Hey Everybody,

I am having issues, using IPXV_ImportConverter loading Office documents.
I am pretty sure that I have the appropriate converter, but there seems to be an issue concerning the interaction with Office.
Whenever i try to load a MS Word document, a message box pops up after a short delay, indicating that there is a queue of documents, that has not been processed for a while.
I can then abort in various ways or wait.

I am using MS Word 2016
I attached a picture of the message i get (it is in German though)
Attachments
errorOffice.PNG

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Wed Oct 31, 2018 1:29 pm

Hello Kutusow,

From the first look it seems like a bug - we will investigate further.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Wed Oct 31, 2018 3:57 pm

Hello Kutusow,

We've tested this in our environment and everything worked.
1. What DLL version are you using (also Win32 or x64)?
2. What Windows version are you using (also Win32 or x64)?
3. What processor do you have?
4. Does this occur each time that you do that or once in a while? Same goes for files.
5. What coding language are you using?

Also, a small sample project would be perfect.


Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Mon Nov 05, 2018 7:52 am

Hey,

thank you for the reply.

1. DLL version should be 7.0.0327.0000 and x86
2. Windows 10 Enterprise 64-Bit
3. AMD FX 6300
4. yes it occurs each time, with all types of office related files
5. C#

Here is the code i use. I get the same issue, when i try to use this code in the TiffExtractor Example project.
I added a modified Version of it as an Attachment.

Code: Select all

var importCV = FindNeededImportConverter(Path.GetExtension(fileName)); // gets the appropriate importconverter
PDFXEdit.IAFS_Name name = m_fsInst.DefaultFileSys.StringToName(fileName);
int openFileFlags = (int)(PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_Read | PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
PDFXEdit.IAFS_File destFile = m_fsInst.DefaultFileSys.OpenFile(name, openFileFlags);
PDFXEdit.IPXC_Document doc = importCV.Convert(m_Inst, destFile);
Attachments
TiffExtractor.zip
(836.7 KiB) Downloaded 45 times

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Mon Nov 05, 2018 8:25 am

Hello Kutusow,

Thank's for the info - I will address this to the appropriate developer for further investigation.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Mon Nov 05, 2018 2:59 pm

Hello Kutusow,

There is a small bug with this one - if you pass the NULL ICab parameter - it won't execute further. This is fixed now and should work as intended in the next release. Meanwhile, you can use this method:

Code: Select all

PDFXEdit.ICab cab = m_Inst.GetFormatConverterParams(true, importCV.ID);
PDFXEdit.IPXC_Document Doc = importCV.Convert(m_Inst, destFile, 0, cab);
This will create the default parameters (same as NULL should of done) and pass them to the converter. With this it should work with no problems.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Mon Nov 05, 2018 3:40 pm

Hey,

thanks again.
I added your code, but sadly the issue is still not resolved.
It feels like the time until i get the Messagebox is just a bit longer now.
(Also, "m_Inst.GetFormatConverterParams(true, importCV.ID)" throws an Exception when I try to load a PDF-file with it.)

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Wed Nov 07, 2018 8:47 am

Hello Kutusow,

You can try your previous code (without the ICab fragment) with this fixed dll:
31692.zip
(13.91 MiB) Downloaded 48 times
Note that this is a dev build an it's not guaranteed to be stable and should not be used in the production. It's purpose is only to test whether your problem was fixed.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Mon Nov 12, 2018 12:37 pm

Thank you for the dll

I tried to add a reference to this dll in my project, but I get an error:
"A reference to .dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
The access options are identical to those of my current dll though.
Also, I am not sure which dll i should use for a "Any CPU" project. Could you also provide the 64 version for me to test?

thanks

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Mon Nov 12, 2018 12:44 pm

Hello Kutusow,

Please add the x86/Win32 version to the project build and try that dll with it - Any CPU can use either x86 or x64 dll depending on the settings.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Tue Nov 13, 2018 11:32 am

Hey,

I would like to do that, but I get the error I was writing about.

"A reference to .dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."

For all I can see, access to the file should be alright, since the settings are identical to the ones of the dll I am currently using.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Tue Nov 13, 2018 12:05 pm

Hello Kutusow,

Did you launch the regsvr32 command via the console administrator mode for the new dll?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Tue Nov 13, 2018 2:04 pm

Oh... thanks for the help. I've never done that before.
With your help, I have finally added the dll to my project. But I still can't test it because the dll you gave me is a Core dll, yet the ImportConverter is IPXV.
I think I need the Edit dll for that, no? Am I missing something?

thanks again for your swift replies :)

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Wed Nov 14, 2018 12:58 pm

Hello Kutusow,

Well, you are in the CoreAPI thread - thus the dll. I'm including the newer EditorSDK dlls + Resources:
31692_E.zip
(20.56 MiB) Downloaded 50 times
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Mon Nov 19, 2018 7:28 am

Hey,

I tested it now with the new dll and both (1) with and (2) without the Addition of "cab".
The result is still pretty much the same. The program freezes, waiting for a response from MS Word. But to no avail. After an extended period of time, it finally delivers a Messagebox.
In case (1) using "cab", the text is slightly different. It states that Word won't answer and therefore my file (gives full path) can't be processed, giving me the aforementioned options again.
case (2) delivers the very message from my opening post.

I hope you still have some ideas as to what the problem might be,
thanks

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Tue Nov 20, 2018 6:41 am

Hello Kutusow,
In case (1) using "cab", the text is slightly different. It states that Word won't answer and therefore my file (gives full path) can't be processed, giving me the aforementioned options again.
Can you tell us what message are you getting in this case?
The "Word won't answer" can mean that the office is busy or the office has hanged (those are different scenarios). If you can, please also attach the message box screenshot.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Tue Nov 20, 2018 7:32 am

Sure,
I would translate it as: "Microsoft Word does not answer" in the title, and then "Microsoft Word does not react/respond and the file xxx ist not processed at the moment. What do you want to do?"
I attached a Picture of the Messagebox, again in German.
If it helps, I can use Word in the meantime without any issues.
Attachments
errorOffice2.PNG

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Wed Nov 21, 2018 8:56 am

Hello Kutusow,

I've contacted the appropriate developer - he will take a look into this.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Thu Nov 22, 2018 3:22 pm

Hello Kutusow,

Here's an answer from the developer who investigated this.
On his machine he had this results:
1) Old dll - does not work without the cab parameters specified (the message queue does not move); works OK with cab parameters
2) New dll - works OK with and without the cab parameters
You had these results:
1) Old dll - does not work without the cab parameters specified (the message queue does not move); and also does not work with cab parameters - message "Word won't answer"
2) New dll - same as old - does not work

Possible solutions:
1) You are using the old dll (you did not execute the regsvr32 for the new dll). If these dll are from the different directory - for easy check use Solution Explorer - References - Add Reference - COM tab - (in the appeared list hover mouse over PDF-XChange Editor Type Library) - a pop-up appears with a path to currently used DLL's location.
2) If you don't have an activated MS Office, the old dll with cab parameters passing can also hang.
3) What code exactly are you using (Tiff Extractor or your code that you gave us)?
4) Also, if your documents contain macros - these can also be a problem - they can launch different message boxes and stuff like that that will block the further execution.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Kutusow
User
Posts: 18
Joined: Tue Oct 30, 2018 12:14 pm

Re: Conversion of Office Formats to PDF

Post by Kutusow » Tue Jan 08, 2019 10:53 am

Hey Alex,

thanks a lot for your help.
I changed how the dll is loaded. Now I use the C-export Method as described here. It works fine now without cab (I did not bother to also test it with cab)

again,
thank you for your endeavors!

User avatar
Sasha - Tracker Dev Team
User
Posts: 4433
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Conversion of Office Formats to PDF

Post by Sasha - Tracker Dev Team » Tue Jan 08, 2019 11:38 am

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply