Latex4CorelDRAW icon indicating copy to clipboard operation
Latex4CorelDRAW copied to clipboard

Unhandled exception

Open paultjevdh opened this issue 3 years ago • 6 comments

Hello Jan

I use Latex4CorelDRAW with the CorelDRAW Technical Suite 2018. It has worked on and off for years. Typically it worked again after logging off and on again, or restarting the computer. I have always built Latex4CorelDRAW from the source. Recently it stopped working and only worked again after reinstallation of corelDRAW. Now, 1 month later it fails again, so I'm now reaching out to get some help debugging this. I updated to the latest version of Latex4CorelDRAW, and as said use technical suite 2018. This worked one month ago, but no longer. Perhaps this is the result of a library update in windows?

When I open a new document in CorelDRAW and add a Latex item, I get the edit window and can enter the latex code. I do get a preview. When I click OK, I get the following error dialog:

image

The details are in the enclosed file "new 1.txt" To me this is abracadabra. When running a debug session, the code breaks at line 250 of LatexDialog.cs: image

Can you provide any directions how to proceed debugging this problem?

Best regards, Paul van der Hulst

new 1.txt

paultjevdh avatar Nov 08 '22 11:11 paultjevdh

Can you verify that the "imageFile" is correct and the file has been generated and is in the given path?

janbender avatar Nov 08 '22 11:11 janbender

Hello Jan,

Thanks for your fast response. The file teximport.pdf should be in "C:\Users\paulvdh\AppData\Roaming\Latex4CorelDraw", but as you can see in the image below, I only get dvi, png and ps output.

image

Do you have a suggestion how to fix this?

Best regards, Paul

paultjevdh avatar Nov 08 '22 12:11 paultjevdh

Can you please check if your TeX installation contains the program "dvipng.exe". This is required to convert the dvi to a png.

janbender avatar Nov 08 '22 12:11 janbender

Hi Jan,

It is there, which I believe is to be expected since the png file is generated. I stepped through the program and the png is deleted and recreated on request. The pdf generation fails however, also in a command window. There is no feedback on this, as shown in the image below:

image

I'm beginning to suspect this is a ps2pdf issue possibly in miktex. I also get no output from ps2pdf in texstudio: image

Thanks so far, I will pass this on to miktex. Best regards, Paul

paultjevdh avatar Nov 08 '22 13:11 paultjevdh

I tested with sample2e from the latex base package. From the command line it only works it I type "ps2pdf -dNoOutputFonts sample2e.ps sample2e.pdf" However, if I enter "ps2pdf.exe -dNoOutputFonts sample2e.ps sample2e.pdf" I get no output. It seems the first command runs ps2pdf.bat from the ghostscript installation which is earlier in my path. ps2pdf.exe exists only in the miktex installation, which is on the end of my path and fails.

I temporarily fixed the issue by removing the path to the miktex installation and removing the extension. It now relies on existence of a working ps2pdf in my path. Paul

paultjevdh avatar Nov 08 '22 14:11 paultjevdh

Thanks for reporting this problem. I will add some code to at least create a proper error message if ps2pdf is not found or returns an error.

janbender avatar Nov 09 '22 06:11 janbender