With the cairo update in bug 739096, the functions `cairo_tag_begin` and
`cairo_tag_end` become available, which can be used (with the "Link" tag
type) to generate links in PDF output.

There are two ways to use this. One approach is to issue
`cairo_tag_begin` with an associated URL, then do some drawing, and then
do `cairo_tag_end`; the PDF backend will collect the bounding rect of
whatever gets drawn in between the begin/end pair, and generate a link
for this area. The alternative is to explicitly pass a rect (or list of
rects) to `cairo_tag_begin`, rather than relying on the backend to
collect the affected area.

I've experimented with both options, and it seems to me that we get a
better result by explicitly passing the frame rect of whatever frame(s)
are associated with the link, rather than depending on cairo's
accumulation of the area between begin and end. This results in
clickable PDF links that better match the clickable areas of the HTML
document as viewed in the browser. (Which makes sense, as the active
area of an HTML link is determined by the frame's area, not by the
actual rendered ink.)

Currently, only the PDF backend supports generating links like this. On
macOS, our Save as PDF functionality actually goes via the cairo-quartz
backend and the macOS printing architecture, rather than cairo's PDF
backend. So to support links there, we'll need to add support for tag
begin/end to the quartz surface. Fortunately, we don't currently need to
implement everything that the PDF backend provides; just supporting
tag_begin with the Link type and an explicit rect will provide enough
functionality here.

(Eventually, it would be awesome to implement more Tagged PDF support --
e.g. to tag document structure, internal destinations, etc -- but that's
for another day, another bug.)

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to thunderbird in Ubuntu.
https://bugs.launchpad.net/bugs/1551949

Title:
  Printing to PDF file loses URLs/links

Status in Mozilla Thunderbird:
  In Progress
Status in thunderbird package in Ubuntu:
  Confirmed

Bug description:
  Steps to reproduce:

  1. File -> Print...
  2. Select "Print to File".
  3. Enter the file name.
  4. Enter the save-to folder.
  5. Leave the output format as-is, or select PDF if it's not the default.
  6. Hit the Print button.
  7. Open the resulting PDF in any PDF viewer.

  
  Actual results:

  The URLs within the document are not actually hyperlinks.  They are
  simply text, coloured blue and underlined.

  
  Expected results:

  Any clickable links on the original e-mail message should be retained
  when converting the document to PDF format.

  ProblemType: Bug
  DistroRelease: Ubuntu 15.10
  Package: thunderbird 1:38.5.1+build2-0ubuntu0.15.10.1
  ProcVersionSignature: Ubuntu 4.2.0-30.35-generic 4.2.8-ckt3
  Uname: Linux 4.2.0-30-generic x86_64
  AddonCompatCheckDisabled: False
  ApportVersion: 2.19.1-0ubuntu5
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC1:  colan      2383 F.... pulseaudio
   /dev/snd/controlC0:  colan      2383 F.... pulseaudio
  BuildID: 20160106101030
  Channel: Unavailable
  CurrentDesktop: Unity
  Date: Tue Mar  1 15:53:53 2016
  EcryptfsInUse: Yes
  ExecutablePath: /usr/lib/thunderbird/thunderbird
  Extensions: extensions.sqlite corrupt or missing
  ForcedLayersAccel: False
  IfupdownConfig:
   # interfaces(5) file used by ifup(8) and ifdown(8)
   auto lo
   iface lo inet loopback
  IncompatibleExtensions: Unavailable (corrupt or non-existant 
compatibility.ini or extensions.sqlite)
  IpRoute:
   default via 192.168.1.1 dev wlan0  proto static  metric 600 
   169.254.0.0/16 dev wlan0  scope link  metric 1000 
   192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.140  
metric 600
  Locales: extensions.sqlite corrupt or missing
  MostRecentCrashID: bp-1abc004a-043e-4a15-bdc0-45ade2150908
  Plugins:
   Google Talk Plugin Video Renderer - /opt/google/talkplugin/libnpo1d.so 
(google-talkplugin)
   Google Talk Plugin - /opt/google/talkplugin/libnpgoogletalk.so 
(google-talkplugin)
   iTunes Application Detector - 
/usr/lib/mozilla/plugins/librhythmbox-itms-detection-plugin.so 
(rhythmbox-mozilla)
   Shockwave Flash - /usr/lib/adobe-flashplugin/libflashplayer.so 
(adobe-flashplugin)
  ProcEnviron:
   LANGUAGE=en_CA:en
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_CA.UTF-8
   SHELL=/bin/zsh
  Profiles: Profile0 (Default) - LastVersion=38.5.1/20160106101030 (In use)
  RelatedPackageVersions:
   google-talkplugin 5.41.0.0-1
   rhythmbox-mozilla 3.2.1-1ubuntu3.1
   adobe-flashplugin 1:20160209.1-0ubuntu0.15.10.1
  RunningIncompatibleAddons: False
  SourcePackage: thunderbird
  SubmittedCrashIDs:
   bp-1abc004a-043e-4a15-bdc0-45ade2150908
   bp-c8c94f9f-0c39-42d2-97ac-f2c7d2150713
  Themes: extensions.sqlite corrupt or missing
  UpgradeStatus: Upgraded to wily on 2015-11-30 (92 days ago)
  dmi.bios.date: 07/09/2013
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: 4.6.5
  dmi.board.asset.tag: Tag 12345
  dmi.board.name: Galago UltraPro
  dmi.board.vendor: System76, Inc.
  dmi.board.version: galu1
  dmi.chassis.asset.tag: No Asset Tag
  dmi.chassis.type: 9
  dmi.chassis.vendor: System76, Inc,
  dmi.chassis.version: galu1
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd07/09/2013:svnSystem76,Inc.:pnGalagoUltraPro:pvrgalu1:rvnSystem76,Inc.:rnGalagoUltraPro:rvrgalu1:cvnSystem76,Inc,:ct9:cvrgalu1:
  dmi.product.name: Galago UltraPro
  dmi.product.version: galu1
  dmi.sys.vendor: System76, Inc.

To manage notifications about this bug go to:
https://bugs.launchpad.net/thunderbird/+bug/1551949/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to