last day (15 days later) » 

10:39 AM
Hi man, so i report my current code with current error:
$im = new \Imagick();
$im->readImage(Mage::getBaseUrl().DS.'clienti'.DS.$customerName.DS. 'flooop.pdf');
 
hello
 
Error is this:
 
which error
 
ImagickException: PDFDelegateFailed `Impossible to find file.
' @ error/pdf.c/ReadPDFImage/794 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:179
Stack trace:
#0 C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml(179): Imagick->readimage('C:\\xampp\\htdocs...')
#1 C:\xampp\htdocs\higiftit\app\code\core\Mage\Core\Block\Template.php(241): include('C:\\xampp\\htdocs...')
 
echo Mage::getBaseUrl().DS.'clienti'.DS.$customerName.DS. 'flooop.pdf' and check file exists
 
10:41 AM
ok, i try
 
check file exists in proper localtion
 
The file is in folder but for check if the file exist how can i do? Thanks
Ok, i checked this with this code e the file exist!
$filename = Mage::getBaseDir().DS.'clienti'.DS.$customerName.DS. 'flooop.pdf';

if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
 
let me check
 
ok
 
path error you have to give absolute path in readImage
 
11:00 AM
I tried to define absolute path but not work again. This is the code:
define('ROOTPATH', __DIR__);

$filename = ROOTPATH.'\flooop.pdf';

if (file_exists($filename)) {
echo "The file $filename exists";
$im = new imagick();
$im->readImage($filename);
} else {
echo "The file $filename does not exist";
}
 
print ROOTPATH and send me screen short where pdf upload
 
Furthermore, the absolute path does not allow me to take the files that are earlier than the current path
ok
ROOTPATH: C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\flooop.pdf
Instead the file I want to take is here:
C:\xampp\htdocs\higiftit\clienti\John Doe\floop.pdf
 
remove space between John Doe
 
ok
i try
 
Mage::getBaseDir()."/clienti/JohnDoe/floop.pdf"
 
11:16 AM
For this way the file exist:
$filename = Mage::getBaseDir()."\clienti\JohnDoe".DS."flooop.pdf";

if (file_exists($filename)) {
echo "The file $filename exists";
/*$im = new imagick();
$im->readImage($filename);*/
} else {
echo "The file $filename does not exist";
}
But when i try to add imagick for read pdf file the result is the same
ImagickException: PDFDelegateFailed
 
$im = new \Imagick();
$im->readImage(Mage::getBaseDir()."/clienti/JohnDoe/floop.pdf");
$Filename=Mage::getBaseDir()."/clienti/JohnDoe/floop.pdf";
$im = new \Imagick();
$im->readImage($Filename);
use last one
 
yes
I tried this: $Filename=Mage::getBaseDir()."/clienti/JohnDoe/flooop.pdf";
$im = new \Imagick();
$im->readImage($Filename);
but again with same error :(
 
have you rename this folder JohnDoe
 
yes now the folder is JohnDoe
 
11:31 AM
still same error
 
exactly
ImagickException: PDFDelegateFailed
 
send me error once again
 
ok
 
which OS you are using
Install Ghostscript 9.22 installation that was 64-bit, I uninstalled that and installed Ghostscript 9.22 32-bit. Issue Fixed.

Thanks for your help.
 
ImagickException: PDFDelegateFailed `Impossibile trovare il file specificato.
' @ error/pdf.c/ReadPDFImage/794 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:182
Stack trace:
#0 C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml(182): Imagick->readimage('C:\\xampp\\htdocs...')
#1 C:\xampp\htdocs\higiftit\app\code\core\Mage\Core\Block\Template.php(241): include('C:\\xampp\\htdocs...')
I have windows 10
How can I check if ghostscript is already installed in my local xampp?
 
11:34 AM
echo $Filename=Mage::getBaseDir()."/clienti/JohnDoe/flooop.pdf"
and send me screen shot where file install
I can come within 10 mintues
 
Result of $Filename is C:\xampp\htdocs\higiftit/clienti/JohnDoe/flooop.pdf
The file is installed here:
Ok man, thanks for now ;)
 
is it solve
 
yes
 
can you accept my answer
I also tried to bring my pdf file in the same folder as my php file and the error is this: ImagickException: UnableToOpenBlob 'flooop.pdf': No such file or directory @ error / blob.c / OpenBlob / 3315 — Gabriel91 Dec 24 '19 at 9:54
it will great help
skype id "jinesh_chauhan"
please accept my answer
are you there?
 
11:49 AM
Of course
 
please do that If it solve your problem
 
But for now the problem is not solved...
 
what error it get
 
I sent you the print of the variable you asked me, any ideas?
this error:
 
ImagickException: PDFDelegateFailed `Impossibile trovare il file specificato.
' @ error/pdf.c/ReadPDFImage/794 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:182
 
11:53 AM
yes
ImagickException: PDFDelegateFailed `Impossibile trovare il file specificato.
' @ error/pdf.c/ReadPDFImage/794 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:182
Stack trace:
#0 C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml(182): Imagick->readimage('C:\\xampp\\htdocs...')
#1 C:\xampp\htdocs\higiftit\app\code\core\Mage\Core\Block\Template.php(241): include('C:\\xampp\\htdocs...')
 
echo $Filename = __DIR__."/clienti/JohnDoe/flooop.pdf";
$im = new \Imagick();
$im->readImage($Filename);
 
Different error at this time:
ImagickException: UnableToOpenBlob 'C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload/clienti/JohnDoe/flooop.pdf': No such file or directory @ error/blob.c/OpenBlob/3315 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:181
With DIR get full path of my current page and a part of path of my pdf file
 
echo $Filename =$_SERVER['DOCUMENT_ROOT']."/clienti/JohnDoe/flooop.pdf";
$im = new \Imagick();
$im->readImage($Filename);
 
With last code i have this error:
ImagickException: UnableToOpenBlob 'C:/xampp/htdocs/clienti/JohnDoe/flooop.pdf': No such file or directory @ error/blob.c/OpenBlob/3315 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:181
I trie to add the name of missing folder
echo $Filename =$_SERVER['DOCUMENT_ROOT']."/higiftit/clienti/JohnDoe/flooop.pdf";
$im = new \Imagick();
$im->readImage($Filename);
and the error back's is the same:
ImagickException: PDFDelegateFailed `Impossibile trovare il file specificato.
' @ error/pdf.c/ReadPDFImage/794 in C:\xampp\htdocs\higiftit\app\design\frontend\sns_toronto\default\template\customer\upload\area-invio-file.phtml:181
Man i come back in 1 hour...
 
can we talk in skype?
May I know where you write this code
 
1:04 PM
On skype i cannot speak, sorry
this code is on custom customer account page of Magento 1.9.4.2
 
1:24 PM
Are you here?
 
2:07 PM
I tried to install Ghostscript on windows 10 on 32 bit but again without result...
 

last day (15 days later) »