English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottomPage: 1
TOPIC: Export PDF with images
#3867
Export PDF with images 14 Years, 8 Months ago Karma: 0
Hey, there!

I'm creating a custom PDF exporter for my boss, but there is a problem to generate the PDF, depending on the images path. Relative paths didn't work, so I tried to replace them with the full path, like www.domain.com/images/stories

it actually worked for images in the master site, but images located at www.domain.com/multisites/slave/images/stories didn't work. I think the problem may be related to the symbolic links, but I cant figure out what to do next...

any help, please?

thanks in advance!
blpagno
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3893
Re: Export PDF with images 14 Years, 8 Months ago Karma: 0
that must come from rules into the template that you create and it depends on whether you choose to copy the image folder or symbolic link
sguif
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3937
Re:Export PDF with images 14 Years, 8 Months ago Karma: 0
Actually the template rules are working fine, cause all the sites are showing the images correctly.

The only problem happens only when generating the PDF, where those paths don't seem to work.

any other hint would be great!
blpagno
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3942
Re:Export PDF with images 14 Years, 8 Months ago Karma: 54
Can you give us a URL to see it.
Does the images are coming from specifc modules or extensions ?
Does the images are displayed using "plugins" ?
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/04/16 09:00 By edwin2win.
The administrator has disabled public write access.
 
#3945
Re:Export PDF with images 14 Years, 8 Months ago Karma: 0
The images that dont work come from the slave sites's "images/stories" folder.

Code:

$pdf = new JDocumentPDF();
$pdf->setTitle($article['title']);
$pdf->setName($article['alias']);
$pdf->setDescription($article['metadesc']);
$pdf->setMetaData('keywords', $article['metakey']);
$pdf->setBuffer($article['introtext'] . $article['fulltext']);
$this->writeFile($pdf, $folder);



Code:

    function writeFile($pdf, $folder) {
        $data = $pdf->render();
        $file = fopen($this->_getDestinationFilePath($pdf->getTitle(), $folder), "w");
        fwrite($file, $data);
        fclose($file);
    }



I must be missing something simple I guess, but the code works for everything, except images from the slave site... in the slave site.

I'm using the core Joomla PDF exporter (TCPDF) and writing the content to a file.
blpagno
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#3946
Re:Export PDF with images 14 Years, 8 Months ago Karma: 54
This peace of code still does not replied to my question.

I have tested the PDF and it works perfectly with the images included normally.
If you are using Plugin it may be possible that these plugin does not render correctly in a PDF.
When I have tested with a "Simple Image Gallery", I have retreived the pattern used to display the images.
When I have used the normal "image" insertion, it works.

So I repeat the question, which kind of images do you put in the articlles.
Are you using special extension for the images rendering.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/04/16 21:24 By edwin2win.
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla