dokuwiki-plugin-dw2pdf icon indicating copy to clipboard operation
dokuwiki-plugin-dw2pdf copied to clipboard

Port numbers not supported in mpdf class

Open SantiPR opened this issue 13 years ago • 5 comments

When you try to print a wiki page with embedded images, if the url site is like "http://host:port", the function GetFullPath don't process paths correctly.

I thought that there is an error in for loop, because it is processing over $path var but I presume that must be over $filepath var.

- for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $path = substr( $path, 0 , strrpos($path,"/") );
+ for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $filepath = substr( $filepath, 0 , strrpos($filepath,"/") );

Another error is when process local link. When $root var is beeing build, the port isný having in account to build the url

   $root = $tr['scheme'].'://'.$tr['host'];  
+ if($tr['port']) $root .= ':'.$tr['port'];

SantiPR avatar Jan 27 '12 10:01 SantiPR

You're right it is broken. I reported it upstream at http://www.mpdf1.com/mpdf/forum/comments.php?DiscussionID=802

Your changes alone seem not to work (but create an infinite loop). I think there's something wrong with how the function treats colons. I'll see to find a fix unless it gets fixed upstream.

splitbrain avatar Jan 27 '12 20:01 splitbrain

Sorry, I'm absolute beginner in PHP. I'm not sure how this changes works for me. The page exported included some images and other visual plugins like note. All of the images in the pages are printed correctly.

If this could help to fix, my installation is in windows and the url is in form http://server:port/dokuwiki. I have configured my dokuwiki to use "/" instead of ":".

If it can help, I can provide some log info about the images that the page print.

PS: sorry for closed and reopen issue.

SantiPR avatar Jan 28 '12 08:01 SantiPR

At the report referered above at the mpdf forum, someone report success for the second change that mentioned above. My understanding is that it fix usage of images. Is implemented by 3c8bf0423e

I haven't tested it...

Klap-in avatar Jun 13 '13 15:06 Klap-in

discussion moved to http://www.mpdf1.com/forum/discussion/802

Klap-in avatar Jan 06 '14 20:01 Klap-in

I have no test setup. So please test results are welcome!

Klap-in avatar Dec 16 '14 14:12 Klap-in