Bug 5051 - PDFs in HTML pages do not scale
Summary: PDFs in HTML pages do not scale
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: PDF (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL: https://jackbalinsky.org/uncover-the-...
Keywords: InRadar
Depends on: 7206
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-19 00:46 PDT by Mac-arena the Bored Zo
Modified: 2024-04-30 11:17 PDT (History)
7 users (show)

See Also:


Attachments
Example of bug. (6.31 KB, application/x-webarchive)
2005-09-19 00:49 PDT, Mac-arena the Bored Zo
no flags Details
a working example of the bug (129 bytes, text/plain)
2024-04-26 17:59 PDT, Frances Cornwall
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mac-arena the Bored Zo 2005-09-19 00:46:54 PDT
when the HTML specifies the width and/or height of an img that is a PDF, the image is cropped rather than 
scaled. (will attach an example.)
Comment 1 Mac-arena the Bored Zo 2005-09-19 00:49:04 PDT
Created attachment 3945 [details]
Example of bug.

a PDF which is 3.5 cm square, shown on the page at 1x and at 5x. instead of
scaling the second img to 5x, it simply crops it to this size (showing the PDF
at 1x magnification in the lower left of a 5x box).
Comment 2 Andre-John Mas 2006-02-11 08:38:12 PST
Observations:
  -  nightly build of 2006-02-11 does not even show the PDFs, instead showing the broken image symbol, while release version 2.0.3 does.
  -  in Safari 2.0.3 images are misaligned, but not in TextEdit
  -  both TextEdit and Safari show images at the same size without the scaling being applied.
  -  is PDF even considered a web-standard image and would an embed not be more suitable for the data type?

BTW would it be possible to save test cases at .zip, so they can be easily be tested with non-webkit based browsers for behaviour comparison?
Comment 3 David Kilzer (:ddkilzer) 2006-02-11 19:51:50 PST
(In reply to comment #2)
>   -  is PDF even considered a web-standard image and would an embed not be more
> suitable for the data type?

I'm not sure, but with PostScript support recently added (Bug 3527), I wonder if inline PostScript would work as well once this is fixed?

> BTW would it be possible to save test cases at .zip, so they can be easily be
> tested with non-webkit based browsers for behaviour comparison?

If you're asking for a new feature in WebKit similar to Firefox's "Save Web Page (Complete)", I would suggest filing a new bug (with a severity of "enhancement").  Otherwise you'll have to use Firefox today to save the web page that way, then zip it up and post it to this bug.
Comment 4 David Kilzer (:ddkilzer) 2006-02-11 20:11:37 PST
Confirming bug on Safari 2.0.3 (417.8) on Mac OS X 10.4.4.

See Bug 7206 for a regression that must be fixed before this one may be fixed.
Comment 5 David Kilzer (:ddkilzer) 2006-02-11 23:34:58 PST
(In reply to comment #3)
> If you're asking for a new feature in WebKit similar to Firefox's "Save Web
> Page (Complete)", I would suggest filing a new bug (with a severity of
> "enhancement").

See Bug 7211.
Comment 6 Dave Hyatt 2006-09-19 03:48:56 PDT
Upping to P1 since the PDF no longer renders and used to.
Comment 7 Dave Hyatt 2006-12-14 22:44:38 PST
Without a working example, I'm not sure what to do here.  The attached sample doesn't work.

Comment 8 Stephanie Lewis 2007-01-27 19:21:07 PST
In Radar <rdar://problem/4959672>
Comment 9 Mark Rowe (bdash) 2007-02-06 23:56:07 PST
The comments suggest this bug is present in Safari 2.0.x, which indicates this is not a regression.
Comment 10 Frances Cornwall 2024-04-26 17:59:24 PDT
Created attachment 471174 [details]
a working example of the bug
Comment 11 Frances Cornwall 2024-04-26 18:36:41 PDT
It looks like CSP is blocking inline styles that the PDF Plugin is trying to load in Safari 17.4.1.

The bug is not in the mini-browser.

It looks like it was fixed by: https://github.com/WebKit/WebKit/pull/27271 and related to bug: https://bugs.webkit.org/show_bug.cgi?id=272689.

The PDF Plugin is now not able to scroll in the mini-browser.
Comment 12 Karl Dubost 2024-04-29 19:41:35 PDT
@brandon, do you think this is a duplicate of Bug 272689
Comment 13 Brandon 2024-04-30 07:58:10 PDT
@karl My PDF fix did not fully resolve this issue. The sizing is correct, but the PDF is still not loading with my change (checked in mini browser).
Comment 14 Brandon 2024-04-30 09:58:40 PDT
Downloaded the latest build from https://webkit.org/build-archives/#mac-sonoma-x86_64%20arm64 and the issue doesn't reproduce for me now.
Comment 15 Brandon 2024-04-30 11:17:31 PDT
This should probably be marked as fixed. It was fixed in https://github.com/WebKit/WebKit/pull/27271