Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7948925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:51:35+00:00 2026-06-04T01:51:35+00:00

I use imagemagick to render a PDF (generated by pdfLaTex) as an image: convert

  • 0

I use imagemagick to render a PDF (generated by pdfLaTex) as an image:

convert -density 120 test.pdf -trim test.png

Then I use this image in an HTML file (in order to include latex code in an own wiki engine).

But of course, the PNG file doesn’t have any hyperlink the PDF file contains.

Is there any possibility to extract the coordinates and target URLs of the hyperlinks too, so I can build a HTML image map?

If it makes a difference: I only need external (http://) hyperlinks, no PDF-internal hyperlinks. A text-based solution like pdftohtml would be unacceptable, since the PDFs contain graphics and formulars too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:51:36+00:00Added an answer on June 4, 2026 at 1:51 am

    Imagemagick uses Ghostscript to render the PDF file to an image. You could also use Ghostscript to extract the Link annotations. In fact the PDF interpreter already does this for the benefit of the pdfwrite device, so that it can produce PDF files with the same hyperlinks as the original.

    You would need to do a small amount of PostScript programming, let me know if you want some more details.

    In gs/Resource/Init the file pdf_main.ps contains large parts of the PDF interpreter. In there you will find this:

      /Link {
        mark exch
        dup /BS knownoget { << exch { oforce } forall >> /BS exch 3 -1 roll } if
        dup /F knownoget { /F exch 3 -1 roll } if
        dup /C knownoget { /Color exch 3 -1 roll } if
        dup /Rect knownoget { /Rect exch 3 -1 roll } if
        dup /Border knownoget {
    ....
        } if
        { linkdest } stopped 
    

    That code processes Link annotations (the hyperlinks in the PDF file). You could replace the ‘linkdest’ with PostScript code to write the data to a file instead, which would give you the hyperlinks. Note that you would also need to set -dDOPDFMARKS on the command line, as this kind of processing is usually disabled for rendering devices, which can’t make use of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use ImageMagick to convert an EPS to a PNG and
When I open a command window in windows and use the imagemagick convert command:
I have some websites that use ImageMagick to convert images and place them in
I have to use imagemagick convert command from php. So I'm using shell_exec but
I want to define a function that call imagemagick to convert an image. def
I'm trying to use Imagemagick convert.exe with Flex4 NativeProcess. I know I have it
I am trying to use ImageMagick to extent an image a little bit: my
From command line with imagemagick, you can use: convert dragon.gif -resize 64x64^ -gravity center
I'm trying to use the ImageMagick toolkit in Drupal, but keep getting this error:
How do I tile an image using ImageMagick? I don't think I can use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.