Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a636f519037e5b4d54d5477f30114f933a1eb5eb
      
https://github.com/WebKit/WebKit/commit/a636f519037e5b4d54d5477f30114f933a1eb5eb
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2025-12-01 (Mon, 01 Dec 2025)

  Changed paths:
    M Tools/MiniBrowser/Configurations/MiniBrowser.xcconfig
    M Tools/MiniBrowser/mac/WK2BrowserWindowController.m

  Log Message:
  -----------
  [MiniBrowser] Use -[PDFDocument writeToURL:] instead of NSData analogue for 
"Save as PDF"
https://bugs.webkit.org/show_bug.cgi?id=303275
rdar://165576176

Reviewed by Wenson Hsieh.

MiniBrowser's "Save as PDF" was using -[NSData writeToURL:options:error:]
to save the PDF data returned by WKWebView's createPDFWithConfiguration:.
This method writes the raw PDF data to disk without processing it through
PDFKit, which can result in link annotations being lost or not properly
preserved in the output file.

Using -[PDFDocument writeToURL:] instead ensures that PDFKit properly
handles the PDF structure, including all annotations such as clickable
links, when writing to disk.

* Tools/MiniBrowser/Configurations/MiniBrowser.xcconfig:
Add PDFKit framework to MiniBrowser's linker flags.

* Tools/MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController saveAsPDF:]):
Create a PDFDocument from the PDF data and use its writeToURL: method
instead of writing the raw NSData directly.

Canonical link: https://commits.webkit.org/303687@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to