1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:37:34 +00:00

LibPDF: Implement GoTo action for outline

Outline items can contain either a /Dest key or an /A key.

The /Dest key points to a "Destination" (various ways to reference a
page in the same document).

The /A key points to an "Action" which can have several types.
One type, the /GoTo type, just also points to a Destination.

Implement GoTo actions. This makes clicking "Contents" in the outline of
https://developer.apple.com/library/archive/documentation/mac/pdf/Text.pdf
work. (Almost all other items in this file's outline use /Dest.
"Contents" could too, but it uses /A /GoTo for some reason.)

(Other action types are things like opening a hyperlink, opening a
different file, playing a sound, submitting a form, etc. Actions
are also used for in-page links, not just in outlines. Many of
these action types we'll likely never want to implement.)
This commit is contained in:
Nico Weber 2023-10-17 08:07:59 -04:00 committed by Tim Flynn
parent d9c9510d3c
commit 182639217f
2 changed files with 18 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <AK/DeprecatedFlyString.h>
#define ENUMERATE_COMMON_NAMES(X) \
X(A) \
X(AIS) \
X(Alternate) \
X(ASCII85Decode) \
@ -134,6 +135,7 @@
X(Root) \
X(Rotate) \
X(RunLengthDecode) \
X(S) \
X(SA) \
X(SM) \
X(SMask) \