Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated for coreldraw 2020 #6

Closed
wants to merge 6 commits into from
Closed

updated for coreldraw 2020 #6

wants to merge 6 commits into from

Conversation

NelisW
Copy link

@NelisW NelisW commented Sep 7, 2020

original code gave error message: changed init(string template, bool useTemplate, string title) to put selectall inside else clause

original code gave error message: changed init(string template, bool useTemplate, string title) to put selectall inside else clause
@janbender
Copy link
Member

I didn't have time yet to test the changes on my system but I just took a short look on them. Maybe it would be good to add a new file Latex4CorelDraw2020.csproj instead of changing the current Latex4CorelDraw.csproj. In this way it would work on both versions.

@paolo-fix
Copy link

Any idea why I obtain that the docker shows an empty interface?
I'm using Corel Draw 2019...
Many thanks
Paolo
Cattura

@janbender
Copy link
Member

If the docker is empty, CorelDraw did not load the plugin due to some reason. Did you use the precompiled binaries? They were compiled for CorelDraw x8. So for your version you have to recompile the plugin. Maybe also take a look at this comment:

#4 (comment)

@paolo-fix
Copy link

paolo-fix commented Nov 9, 2020 via email

C:\Program Files\Corel\CorelDRAW Graphics Suite 2020\Programs64\Addons\Latex4CorelDraw
@NelisW
Copy link
Author

NelisW commented Nov 10, 2020 via email

@janbender
Copy link
Member

Hi Paolo, I think the fork of NelisW could help you. Unfortunately, I did not find the time yet to merge it but I think it would make sense to add multiple project files for different versions of CorelDraw. Since I have an older version, I cannot provide the binaries.

@livesdlc
Copy link

livesdlc commented Mar 28, 2021

It does not work on any version. Tested on Corel X7, X8 and 2020, 64 bit and Windows 10. I followed exactly the steps. Nothing works. Docker is empty. Me fez perder um puta tempo.

@NelisW
Copy link
Author

NelisW commented Mar 28, 2021 via email

@paolo-fix
Copy link

paolo-fix commented Mar 28, 2021 via email

@paolo-fix
Copy link

paolo-fix commented Mar 28, 2021 via email

@NelisW
Copy link
Author

NelisW commented Mar 29, 2021 via email

@alecsilveira
Copy link

Thank you all. I have it working on CorelDraw 2021.

Regards,
Alex

@paolo-fix
Copy link

Dear Nelis,
After about one year of your unvaluable and successful help, I'm afraid I need it again... (I had to reinstall my system)
Using your files and following your instructions:

  1. I modified Latex4CorelDraw.csproj (to replace original path C:\Program Files\Corel\CorelDRAW Graphics Suite 2020\ to C:\Program Files\Corel\CorelDRAW Graphics Suite 2019) and
  2. compiled Latex4CorelDraw project with VS2017 CE (with no errors).
  3. 9 files are created in the C:\Program Files\Corel\CorelDRAW Graphics Suite 2019\Programs64\Addons\Latex4CorelDraw, including Latex4CorelDraw.dll.

However, it seems results are only partly successful.
On the one side, the Latex Docker pops-up and I succeed to regularly "preview" math equations.
image

Yet, after a few seconds that I click on OK to confirm, an error message appears, saying that
System.Runtime.InteropServices.COMException (0x80004005): Errore HRESULT E_FAIL returned by a call to a COM component (see later for additional messages)
and the equation does not paste into CorelDraw (below I pasted a translation in English...)
image

I can replicate the error. I also have the details of the problem detected using the Debug of VS2017.
image
image

An (almost random) detail that I checked is that the imagefile:
C:\Users\Paolo\AppData\Roaming\Latex4CorelDraw\teximport.pdf
is not actually created. This is what I see in that folder during the debugging.
image

Useless to say, If you could solve of this, it would be a huge help! I really have no clue how to solve this... (I can send you my email address and provide the detalis of debugging, if you like).

best, Paolo


in Corel.Interop.VGCore.LayerClass.ImportEx(String FileName, cdrFilter Filter, StructImportOptions Options)
in Latex4CorelDraw.LatexDialog.generateEquation(Boolean createShape)
in System.Windows.Forms.Control.OnClick(EventArgs e)
in System.Windows.Forms.Button.OnClick(EventArgs e)
in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ButtonBase.WndProc(Message& m)
in System.Windows.Forms.Button.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Hi Paolo Try this version, I am not sure it will work though. I don't have a Windows c++ compiler currently, we are currently using the Linux compilers on WSL2. Very nice to boot in Windows but have command line access to linux. The next version of WSL later this year will have full Linux gui and gpu support. The best would be for you to install visual studio 2019 CE and build the Release version dll file for your coreldraw version, follow my work flow, but change CD version as per your required need. Then, once the dll is built, copy it over my version. Only the one Latex4CorelDraw.dll file need to rebuilt, the other files should work fine. Sorry, I would not be able to compile new binaries: I have no current need to load visual studio on Windows. Jan Bender did a very good job with the addon, so if you are able to compile the dll, all should be fine. Good luck!

On Mon, 29 Mar 2021, 00:00 paolo-fix, @.> wrote: Dear Nelis, Let me first thank you sincerely. However I'm afraid we have a small problem... Do you think your late solution could work also on my version 2019? I expect not, given the usual strict link of the compilation each different version. But maybe your new approach is more general. Best regards, Paolo Il giorno dom 28 mar 2021 alle ore 13:15 Nelis Willers < @.> ha scritto: > Hi > > I checked the files just now, installing to a new PC. It works. > I rewrote the readme to be more explicit for my procedure [we are not > following the original Jan Bender procedure any more]. > please try the new writeup (attached hereto and also pushed to github). > > all of the best > > n > > On Sun, 28 Mar 2021 at 03:11, caiosilva1993 @.***> > wrote: > > > It does not work on any version. Tested on Corel X7, X8 and 2020, 64 bit. > > I followed exactly the steps. Nothing works. > > > > — > > You are receiving this because you authored the thread. > > Reply to this email directly, view it on GitHub > > < > #6 (comment) > >, > > or unsubscribe > > < > https://github.com/notifications/unsubscribe-auth/ABOR6SJ2BFSYFQWYQ745YEDTFZ635ANCNFSM4Q5STFJA > > > > . > > > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > < #6 (comment) >, > or unsubscribe > < https://github.com/notifications/unsubscribe-auth/ARUYSKP5ZDQM2N5CKYKVM3LTF4FW3ANCNFSM4Q5STFJA > > . > — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#6 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOR6SM5WLF4VG2QY4XRYY3TF6RG3ANCNFSM4Q5STFJA .

@janbender
Copy link
Member

If the pdf file is not generated, maybe it is a problem with the converter. Could you try to run the PDF conversion command on command line?

@paolo-fix
Copy link

If the pdf file is not generated, maybe it is a problem with the converter. Could you try to run the PDF conversion command on command line?

Jan, I tried with a simple example. Apparently pdflatex correctly works...

image

and the pdf file was generated...
image

Is this the test you meant?

@janbender
Copy link
Member

I meant something similar. In the plugin I first generate a PS file and then convert it in line:

public static bool executePs2Pdf(LatexEquation equation)

The command is:

startProcess("cmd.exe", "/c "" + mgr.SettingsData.miktexPath + "\ps2pdf.exe" -dNoOutputFonts teximport.ps teximport.pdf", true, false, out output);

Or on command line:

\ps2pdf.exe -dNoOutputFonts teximport.ps teximport.pdf

Can you try if this works?

@paolo-fix
Copy link

I meant something similar. In the plugin I first generate a PS file and then convert it in line:

public static bool executePs2Pdf(LatexEquation equation)

The command is:

startProcess("cmd.exe", "/c "" + mgr.SettingsData.miktexPath + "\ps2pdf.exe" -dNoOutputFonts teximport.ps teximport.pdf", true, false, out output);

Or on command line:

\ps2pdf.exe -dNoOutputFonts teximport.ps teximport.pdf

Can you try if this works?

Dear Jan, bingo! 👍
I tried your command from the command line and noticed that the ps2pdf was not recognized! Indeed the System Path (environmental variables of Windows) was including a wrong path to MikTek, that I immediately updated.
After updateing the path, your Latex Addon in CorelDraw immediately generated the desired Latex expression!
Brilliant solution.
Of course, thanks a lot!

image

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants