Re: My dompdf links don't work??

1,056 views
Skip to first unread message

BrianS

unread,
Sep 24, 2012, 11:42:08 AM9/24/12
to dom...@googlegroups.com
Have you checked your input document to make sure these aren't the links represented? You can see the HTML document that is being processed by dompdf calling $dompdf->output_html();.

On Saturday, September 22, 2012 1:25:52 PM UTC-4, Dale Silvey wrote:
Hello everyone!

I installed dompdf on my hosting server. This issue I am having is when a user clicks on my pdf doc button and opens the pdf in adobe the links in the html look like this when hovering over the pdf link:

file:///C|/Users/Me/AppData/Local/Temp/\"http://www.example.com\"

Obviously this does not work. I want to get rid of everything except for the http://www.example.com so that it works properly. Any idea what is causing this and how to fix it?

Thank You!

Dale Silvey

unread,
Sep 24, 2012, 11:49:56 AM9/24/12
to dom...@googlegroups.com
Thanks but that would not be the case since it comes from my hosting company and domain. I checked and the links should be literal links to another website. Here is my code:

$html1 = '<h2 class="articleTitle">';
$html11 = stripslashes($ca["Title"]) ;
$html12 = '</h2>';
$html2 = $ca["ArticleText"] ;
$html = "$logo $html1 $html11 $html12 $html2";

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");

As you can see here, $html2 is calling the pdf body which contains the links that are getting messed up when opening the pdf document. Any ideas?

Dale Silvey

unread,
Sep 24, 2012, 12:11:01 PM9/24/12
to dom...@googlegroups.com
You can see what I mean by going here and clicking on PDF Doc button http://www.pressreleasenews.net/Jacksonville-Criminal-Appeals-Attorneys-Drafts-All-Civil-and-Criminal-Cases.htm


On Monday, September 24, 2012 10:42:08 AM UTC-5, BrianS wrote:

BrianS

unread,
Sep 25, 2012, 11:17:47 AM9/25/12
to dom...@googlegroups.com
Ah, ok. It looks like the problem is the URL itself. It's written in such a way that it's being interpreted by the PDF reader as a link relative to the PDF document. Looking at the PDF itself the URL that's present in the link is something along the lines of \"http://www.jacksonvilleappeallawyer.com/\". Just echo out $html instead of passing it to dompdf to see the problem in your source document. It looks like somewhere along the line the HTML document is being escaped when it doesn't need to be.

If that proves not to be the case we'll need to see the originating HTML so we can debug the issue.
Reply all
Reply to author
Forward
0 new messages