<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>285313</bug_id>
          
          <creation_ts>2025-01-02 12:43:10 -0800</creation_ts>
          <short_desc>[GTK][Skia] When printing to PDF, automatically set the title metadata attribute from the saved webpage&apos;s title</short_desc>
          <delta_ts>2025-01-09 00:51:02 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=268972</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeff Fortin">nekohayo</reporter>
          <assigned_to name="Carlos Garcia Campos">cgarcia</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2084539</commentid>
    <comment_count>0</comment_count>
    <who name="Jeff Fortin">nekohayo</who>
    <bug_when>2025-01-02 12:43:10 -0800</bug_when>
    <thetext>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&apos;s title into the resulting PDF&apos;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 &quot;Print to File&quot; 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&apos;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&apos;s title attribute.

If you want to be extra clever about it, you could automatically detect the website/author name from the webpage&apos;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&apos;s probably what could be set into the PDF&apos;s &quot;author&quot; 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 &quot;Producer&quot; (conversion software) field&apos;s value to &quot;Skia/PDF m133&quot;, but it does not set the &quot;Publisher&quot; (creation software). It might be worth telling it to identify the publisher as WebKitGTK (or the web browser app&apos;s name, if possible)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085774</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2025-01-08 06:26:59 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/38720</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2086009</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-01-09 00:50:59 -0800</bug_when>
    <thetext>Committed 288643@main (78c93bce2efe): &lt;https://commits.webkit.org/288643@main&gt;

Reviewed commits have been landed. Closing PR #38720 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>