Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline MDAions  
#1 Posted : 03 November 2019 00:58:40(UTC)
MDAions

Rank: Newbie

Groups: Registered
Joined: 05/10/2019(UTC)
Posts: 6
France
Location: Paris

Hello,
I call a .bat program from a php.
In this program there is the -silent command to turn an .sm into a .htm.
Unfortunately the result gives images with red crosses.
I guess the necessary plugins are not loaded from the .php call because the same command works well when the .bat is run directly under windows.
Would anyone have a solution to make the .bat work properly from .php ?



Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline MDAions  
#2 Posted : 05 November 2019 01:22:47(UTC)
MDAions

Rank: Newbie

Groups: Registered
Joined: 05/10/2019(UTC)
Posts: 6
France
Location: Paris

Ok, the .bat contains the following command :

"C:\Program Files (x86)\SMath Studio\SMathStudio_Desktop.exe" -silent -e htm "C:\Users\Desktop.sm\Page1.sm"

Also the file Page1.sm contain the following test where the first line is a normal text (font courrier-new) and the second line is a write region text (font arial) :

Page1.sm.png

Then we see the 2 lines on the .htm created directly from the SMathStudio on the desktop by the menu "save as" or the same by the .bat if we call it from the desktop :

Page1_htm_from_desktop.PNG

But when we call the .bat from the PHP we have the first line with the Courrier-new but we got an image with a red cross for the writer region text with the arial character font :

Page1_From_PHP.PNG
Offline Davide Carpi  
#3 Posted : 05 November 2019 10:32:00(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hello, what is the output of this?

Code:

<?php
echo php_uname();
echo PHP_OS;
?>


Also, if you could return the output of this (under php)

Code:
SMathStudio_desktop.exe -s -i

Edited by user 05 November 2019 14:02:50(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline MDAions  
#4 Posted : 06 November 2019 21:25:48(UTC)
MDAions

Rank: Newbie

Groups: Registered
Joined: 05/10/2019(UTC)
Posts: 6
France
Location: Paris

To Jean Giraud : I'm trying to convert, from my wamp server to localhost, a .sm document into an .htm document using the -silent SMathStudio command.

To Davide Carpi : the first code php

<?php
echo php_uname();
echo PHP_OS;
?>

is giving this result :

test001.PNG

the second code under php is running but doing nothing, white board :

<?php
exec('"SMath_Studio\SMathStudio_Desktop.exe" -s -i' )
?>

Offline Davide Carpi  
#5 Posted : 06 November 2019 23:24:37(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Thank you

Originally Posted by: MDAions Go to Quoted Post

<?php
exec('"SMath_Studio\SMathStudio_Desktop.exe" -s -i' )
?>


You have to echo the exec(), also you might have to use and echo the exec() optional 2nd and 3rd arguments...

Edited by user 07 November 2019 12:25:03(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline MDAions  
#6 Posted : 07 November 2019 01:31:09(UTC)
MDAions

Rank: Newbie

Groups: Registered
Joined: 05/10/2019(UTC)
Posts: 6
France
Location: Paris

Yes I tried a pdf but the document is simply not viewable because damaged.
And it is generated with the extension Page1.pdf.tmp besides I forgot to specify that the document htm is also generated with the extension Page1.htm.tmp as well as the format Page1.png.tmp
So far none of the formats is usable and all are damaged.
Then I think it should be more of a wampserveur resource that is missing or a parameter.

Offline MDAions  
#7 Posted : 09 November 2019 12:34:57(UTC)
MDAions

Rank: Newbie

Groups: Registered
Joined: 05/10/2019(UTC)
Posts: 6
France
Location: Paris

Hello, I think I found a track by noticing that the sizes of identical images but generated by each of the 2 exports (1 on desktop ond 1 by php) is different. Which certainly explains why images generated from a .php page are damaged.

Non-writer images that are simply copy-and-paste in an .sm document remain the same size and are not damaged.

Also a remark, would it not be possible to simply not generate images but to take directly the source of the "writer region" ?
Offline Davide Carpi  
#8 Posted : 09 November 2019 16:57:27(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: MDAions Go to Quoted Post
Also a remark, would it not be possible to simply not generate images but to take directly the source of the "writer region" ?



It is possible to change the html export plugin to save Writer Region content as html code. However, since the SS page layout is made by blocks anchored to coordinates (as well as the html output) and the text rendering slightly differs from browser to browser, the output might be a little messed up depending on how much the regions are close each other in the original worksheet.
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline MDAions  
#9 Posted : 09 November 2019 18:52:35(UTC)
MDAions

Rank: Newbie

Groups: Registered
Joined: 05/10/2019(UTC)
Posts: 6
France
Location: Paris

Thank you, I understand the problem, especially because I tried to do a sm2wiki before and it is even more difficult and ugly to align the formulas on 1 line Sad .
Perhaps we can set the output of writers option in html document, as for "-o images = embedded" for example we could have "-o writer = text".
In any case personally I prefer the text even if it is not perfectly aligned. In this case, I am ready to be the beta-tester of this new version Good

Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.