op.openDoc for .MD (Markdown) - force to use "conv.imp.markdown"  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, 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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

op.openDoc for .MD (Markdown) - force to use "conv.imp.markdown"

Post by zarkogajic »

Hi Support,

I can use the "conv.imp.markdown" and the Convert method of the IPXV_ImportConverter to convert an .md (markdown) to PDF - all working as a charm :)

However it seems the Convert method will not display the default ProgressMonitor even if the pProgress parameter is set to either null or Inst.DefaultProgressMon. I guess the reason for this is that Convert() does its work in the main thread (if called from there) - and hence the default progress dialog does not get displayed.
Note: the file is bigger and EUEditor does display the progress when "New - From Markdown" is used for this document.

I've then tried using the op.openDoc operation (via AsyncDoAndWaitForFinish) - and this works but the file is converted as plain text.

I've then tried specifying 'conv.imp.markdown' for Options.UsedConvID and I've also tried specifying Options.ConvParams = GetFormatConverterParams().

In both cases the file is still converted as if plain text. (Am I missing some option for op.openDoc?) What would then UsedConvID / ConvParams be used for?

Is there a way to force op.openDoc to convert the .md file as markdown file?

Or, do I need to call Convert() from a background thread (also using AsyncDoAndWaitForFinish) for the progress to appear (which would mean implementing my own IOperation that would call Convert() in its Do() method)?

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: op.openDoc for .MD (Markdown) - force to use "conv.imp.markdown"

Post by Vasyl-Tracker Dev Team »

- To see the Progress-dialog you need to use the Convert method inside other thread, not in main.
- The problem with importing of MD files via op.openDoc - it cannot be solved from your side, unfortunately. But we will fix it in the next build definitely. The Options.UsedConvID - is the output parameter, Options.ConvParams - is just an optional input array of conv-params (each item of array - is the set of params for certain import-convertor - i.e. this is not suitable for your case).
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.openDoc for .MD (Markdown) - force to use "conv.imp.markdown"  SOLVED

Post by zarkogajic »

Hi Vasyl,

Thanks for confirming.

-žarko
Post Reply