Bug 285313

Summary: [GTK][Skia] When printing to PDF, automatically set the title metadata attribute from the saved webpage's title
Product: WebKit Reporter: Jeff Fortin <nekohayo>
Component: WebKitGTKAssignee: Carlos Garcia Campos <cgarcia>
Status: RESOLVED FIXED    
Severity: Enhancement CC: bugs-noreply, cgarcia
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=268972

Jeff Fortin
Reported 2025-01-02 12:43:10 PST
Same idea as https://bugzilla.mozilla.org/show_bug.cgi?id=1939532 While testing with Epiphany Technology Preview, I noticed that WebKit does not encode the page's title into the resulting PDF's metadata. --- ## Steps to reproduce 1. From any webpage (particularly a news article, for example), hit Ctrl+P. 2. In the GTK print dialog, choose "Print to File" as the output, instead of a physical printer. 3. Save the file somewhere. 4. Open the file with a good PDF reader (like Evince or GNOME Papers) or metadata inspector/editor (like Paper Clip), and inspect the document's properties. ## Actual Result The title has not been set into the exported PDF document. ## Expected Result The title should have been set into the metadata (presumably through Skia?), as it is fairly easy for the browser guess from the webpage's title attribute. If you want to be extra clever about it, you could automatically detect the website/author name from the webpage's metadata or maybe from the last separator in the title (|, -, —, etc.), guessing that if what comes after the separator is much shorter than what came before it, it's probably what could be set into the PDF's "author" metadata field. ## Additional info * This might require changes in Skia (and maybe GTK) if there is no API to set the title etc., but in that case WebKit / WebKitGTK developers are probably the ones best suited to make that request. * Currently, the only metadata it saves is the "Producer" (conversion software) field's value to "Skia/PDF m133", but it does not set the "Publisher" (creation software). It might be worth telling it to identify the publisher as WebKitGTK (or the web browser app's name, if possible)?
Attachments
Carlos Garcia Campos
Comment 1 2025-01-08 06:26:59 PST
EWS
Comment 2 2025-01-09 00:50:59 PST
Committed 288643@main (78c93bce2efe): <https://commits.webkit.org/288643@main> Reviewed commits have been landed. Closing PR #38720 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.