New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal links are not working in pdf generated from wkhtmltopdf #2153

Open
sriharichava opened this Issue Jan 19, 2015 · 15 comments

Comments

Projects
None yet
@sriharichava

sriharichava commented Jan 19, 2015

Dear Team,

i generated a pdf from html page by using the wkhtmltopdf.
I am using below command:
wkhtmltopdf --enable-internal-links test.html test.pdf
I pointed some internal links in pdf those are not working in the pdf, same working in html page.
I am using like below:
Target of the Link:
Content
Link to the Target:
Link Text

Please help me to resolve the Issue.

Thanks,
Srihari Chava

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jan 19, 2015

Member

Please post the version, platform and example HTML.

Member

ashkulz commented Jan 19, 2015

Please post the version, platform and example HTML.

@sriharichava

This comment has been minimized.

Show comment
Hide comment
@sriharichava

sriharichava Jan 20, 2015

Dear Ashish,

Version:
wkhtmltopdf 0.12.2 (with patched qt)
Platform:
Windows server 2008 R2 Enterprise
Unable to upload the html file:
Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG.

Regards,
Srihari Chava

sriharichava commented Jan 20, 2015

Dear Ashish,

Version:
wkhtmltopdf 0.12.2 (with patched qt)
Platform:
Windows server 2008 R2 Enterprise
Unable to upload the html file:
Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG.

Regards,
Srihari Chava

@ashkulz

This comment has been minimized.

Show comment
Hide comment
@ashkulz

ashkulz Jan 20, 2015

Member

HTML? Also try using <span id="whatever">content</span>

Member

ashkulz commented Jan 20, 2015

HTML? Also try using <span id="whatever">content</span>

@ewartgh

This comment has been minimized.

Show comment
Hide comment
@ewartgh

ewartgh Feb 2, 2015

Here is another example of a page that doesn't have the internal links generated, any ideas why? The HTML looks acceptable.

http://www.sec.gov/Archives/edgar/data/789019/000119312514289961/d722626d10k.htm#tx722626_2

ewartgh commented Feb 2, 2015

Here is another example of a page that doesn't have the internal links generated, any ideas why? The HTML looks acceptable.

http://www.sec.gov/Archives/edgar/data/789019/000119312514289961/d722626d10k.htm#tx722626_2

@mcahornsirup

This comment has been minimized.

Show comment
Hide comment
@mcahornsirup

mcahornsirup Jul 13, 2015

Verified. Same issue here.

mcahornsirup commented Jul 13, 2015

Verified. Same issue here.

@borkdude

This comment has been minimized.

Show comment
Hide comment
@borkdude

borkdude Sep 17, 2015

Same issue here.

borkdude commented Sep 17, 2015

Same issue here.

@borkdude

This comment has been minimized.

Show comment
Hide comment
@borkdude

borkdude Sep 17, 2015

@sriharichava @mcahornsirup I had this issue when using an empty link. When I inserted a nbsp, it worked.

borkdude commented Sep 17, 2015

@sriharichava @mcahornsirup I had this issue when using an empty link. When I inserted a nbsp, it worked.

@radumas

This comment has been minimized.

Show comment
Hide comment
@radumas

radumas Sep 29, 2015

Same issue with wkhtmltopdf 0.12.2.1 (with patched qt) on Ubuntu 14.04.3 LTS

radumas commented Sep 29, 2015

Same issue with wkhtmltopdf 0.12.2.1 (with patched qt) on Ubuntu 14.04.3 LTS

@illegalnumbers

This comment has been minimized.

Show comment
Hide comment
@illegalnumbers

illegalnumbers Nov 16, 2015

Same issue, Ubuntu 14.04 as well

illegalnumbers commented Nov 16, 2015

Same issue, Ubuntu 14.04 as well

@mcahornsirup

This comment has been minimized.

Show comment
Hide comment
@mcahornsirup

mcahornsirup Nov 30, 2015

Nice. I'll try to use a nbsp...

mcahornsirup commented Nov 30, 2015

Nice. I'll try to use a nbsp...

@seafoambream

This comment has been minimized.

Show comment
Hide comment
@seafoambream

seafoambream Jul 26, 2016

I'm having the same issue with a software that uses wkhtmltopdf.
Please see the thread in the following link and let me know if you'd like me to provide you with any other information.

http://forums.apricitysoftware.com/t/pdf-export-with-working-links/233/8

I added the latest comment in the thread, which seems like a interesting find, but I'm not a programmer so I don't know for sure. Thanks.

seafoambream commented Jul 26, 2016

I'm having the same issue with a software that uses wkhtmltopdf.
Please see the thread in the following link and let me know if you'd like me to provide you with any other information.

http://forums.apricitysoftware.com/t/pdf-export-with-working-links/233/8

I added the latest comment in the thread, which seems like a interesting find, but I'm not a programmer so I don't know for sure. Thanks.

@justintocci

This comment has been minimized.

Show comment
Hide comment
@justintocci

justintocci Nov 21, 2016

same issue on Fedora release 24 with wkhtmltopdf 0.12.3 (with patched qt)

I tried adding a space, linking a bunch of different ways.

I also tried --enable-internal-links and --disable-external-links, no joy.

CentOS Linux release 7.0.1406 (Core) wkhtmltopdf 0.12.2.1 (with patched qt) works just fine so this would seem to be a regression.


I installed wkhtmltopdf 0.12.2.1 (with patched qt) on Fedora release 24 and it works so this is definitely a regression in 0.12.3:
downloaded wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
rpm -Uhv wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
dnf install libpng15
=>now links work

justintocci commented Nov 21, 2016

same issue on Fedora release 24 with wkhtmltopdf 0.12.3 (with patched qt)

I tried adding a space, linking a bunch of different ways.

I also tried --enable-internal-links and --disable-external-links, no joy.

CentOS Linux release 7.0.1406 (Core) wkhtmltopdf 0.12.2.1 (with patched qt) works just fine so this would seem to be a regression.


I installed wkhtmltopdf 0.12.2.1 (with patched qt) on Fedora release 24 and it works so this is definitely a regression in 0.12.3:
downloaded wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
rpm -Uhv wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
dnf install libpng15
=>now links work

@cripton

This comment has been minimized.

Show comment
Hide comment
@cripton

cripton Aug 24, 2017

I write this code in php to replace all the empty links adding a space in large generated html.

$pattern = "/(<a name=.*?>)(<\/a>)/";           
$replacement = "$1&nbsp;$2";                   
$html = preg_replace($pattern, $replacement, $htm);

cripton commented Aug 24, 2017

I write this code in php to replace all the empty links adding a space in large generated html.

$pattern = "/(<a name=.*?>)(<\/a>)/";           
$replacement = "$1&nbsp;$2";                   
$html = preg_replace($pattern, $replacement, $htm);
@denning

This comment has been minimized.

Show comment
Hide comment
@denning

denning Sep 5, 2017

I'm having the same problem, but only on my headless server and not when I run locally. No empty links.

Local (links work)

  • Ubuntu 17.04
  • wkhtmltopdf 0.12.3.2

Remote (links don't work)

  • Ubuntu 16.04.3
  • wkhtmltopdf 0.12.2.4

denning commented Sep 5, 2017

I'm having the same problem, but only on my headless server and not when I run locally. No empty links.

Local (links work)

  • Ubuntu 17.04
  • wkhtmltopdf 0.12.3.2

Remote (links don't work)

  • Ubuntu 16.04.3
  • wkhtmltopdf 0.12.2.4
@Tomsgu

This comment has been minimized.

Show comment
Hide comment
@Tomsgu

Tomsgu Aug 22, 2018

Contributor

Does this work in 0.12.5?

Contributor

Tomsgu commented Aug 22, 2018

Does this work in 0.12.5?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment