J'utilise le fichier ImageMagick PDF en JPG, utilisez PHP shell_exec('convert ./a.pdf ./a.jpg')
shell_exec, ImageMagick pdf aux erreurs jpg de retour
Je reçois cette erreur:
Error: /undefined in findresource Operand stack: --dict:15/24(L)-- F3 16.0 --dict:6/6(L)-- --dict:6/6(L)-- DroidSansFallback-UniGB-UTF16-H --dict:10/12(ro)(G)-- --nostringval-- CIDFontObject --dict:7/7(L)-- --dict:7/7(L)-- Adobe-GB1 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue Dictionary stack: --dict:1154/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:286/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:26/40(L)-- Current allocation mode is local Last OS error: 2
commande dans la console est ok.
La réponse est presque certainement lié au PATH - soit '' convert' ou ghostscript'. Essayez de convertir 'a.jpg' en' b.jpg'. Si cela fonctionne, c'est le chemin de 'ghostscript' qui est faux. Si cela ne fonctionne pas, c'est le chemin à 'convertir 'ou le script n'est pas exécuté dans le dossier que vous pensez qu'il est. –
@ MarkSetchell salut MarkSetchell.J'ai résolu le problème, j'ai ajouté le code 'putenv (" PATH =/usr/local/bin ");' .qui a fonctionné correctement. Merci – Aiden
Excellent, je l'ai élargi et mis comme un réponse complète pour tous - veuillez envisager de l'accepter comme réponse en cliquant sur la coche/coche en regard du nombre de votes. Bonne chance pour votre projet! –