# Is capturing PDFs from developer.apple.com broken?

**URL:** <https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901>\
**Category:** Feedback\
**Created:** [June 3, 2021, 10:53am UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901 "2021-06-03T10:53:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 10:53am UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/1 "2021-06-03T10:53:48Z")

</div>

It seems it’s not possible anymore to reliably capture PDFs. It sometimes works, sometimes fails. Sometimes it works on the second try. Or the third. Or the fourth. I even had to capture PDFs more than 5 times until I got a proper result.

This does not happen for the first time, I’ve seen this for some weeks now. Sometimes it’s sufficient to restart DEVONthink. Sometimes even rebooting doesn’t help - or it seems to have helped but fails again after some time. It’s super frustrating.

This happens with `Clip to DEVONthink` and also with PDFs created via AppleScript.

Example URL:

[https://developer.apple.com/documentation/foundation/url\_loading\_system?language=objc](https://developer.apple.com/documentation/foundation/url_loading_system?language=objc)

Example result:

 ![1](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/6/0/6068cae611e34ed8267592c7113a342a3e4cd885.png)

Expected result:

 ![2](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/8/c/8c84ef11d2252c593a8717370db3241917e25875.png)

**Edit** : It seems to work reliably if the URL is first opened in DEVONthink. I captured 3 times with success from within DEVONthink and 3 times the same URL failed when captured from Safari.

**Edit 2** : It works from within DEVONthink with `Paginated PDF` but fails with `Clip to DEVONthink`

![1](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/8/4/848cf899faa369f0ac04edadd35aa25c1270a635.png)

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [June 3, 2021, 12:14pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/2 "2021-06-03T12:14:12Z")

</div>

Dynamic websites which load the contents on demand (e.g. after user interaction like scrolling or mouse movement) might not clip the desired result (e.g. missing images or contents).

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 12:46pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/3 "2021-06-03T12:46:26Z")

</div>

That doesn’t really explain why it sometimes works for all Apple Developer URLs and sometimes doesn’t work or only after several tries. And why restarting DEVONthink often solves it.

I open those sites but don’t interact with them, i.e. I just capture them. So what I do is always the same, but the results differ. It also doesn’t explain why it’s most often the title and the declaration that’s missing. And if it were because of dynamic content: why does it sometimes work, sometimes not? I really do nothing else than opening the URL, I always read the PDF in DEVONthink, not the site in Safari.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [June 3, 2021, 1:11pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/4 "2021-06-03T13:11:53Z")

</div>

Which browser and macOS version do you use? And how do you activate the Sorter? Via the Clip to DEVONthink extension?

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [June 3, 2021, 1:16pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/5 "2021-06-03T13:16:53Z")

</div>

> [@pete31](#):
>
> And if it were because of dynamic content: why does it sometimes work, sometimes not?

Timing issues? I’m not saying that the problem _is_ related to dynamically loaded/generated content. But for the case of the page that you quoted, I can see this

 ![Bildschirmfoto 2021-06-03 um 15.06.57](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/7/9/79f456f2504bbfff50f78fbeb83d750adfb8ce62.png)  
apart from a bunch of broken CSS styles ☹  
and if you look at the web “page” proper, you’ll see that it is only a bunch of empty `div` elements. They get filled in “later” (i.e. at DOMContentLoaded or load or whenever …) by JavaScript functions.  
So if one of these functions didn’t run or if the server were slow when you capture, it might well be that the document is not complete and only part of it gets captured. I’m wondering if “print to DT” might give better results, supposing that the browser’s built-in print function will wait until the page is fully loaded – which DT for obvious reasons doesn’t know about.

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 1:22pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/6 "2021-06-03T13:22:08Z")

</div>

Yes, via the Extension. But it also happens when I use the share menu in XCode. And it happens with an AppleScript in a Smart Rule.

Safari 14.1.1  
macOS 10.14.6

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 1:23pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/7 "2021-06-03T13:23:30Z")

</div>

> [@chrillek](#):
>
> Timing issues?

I would say possible, but that wouldn’t explain that it also happens via AppleScript.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [June 3, 2021, 1:25pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/8 "2021-06-03T13:25:10Z")

</div>

> [@pete31](#):
>
> Yes, via the Extension.

As the source of the current HTML page from the browser is used, maybe it depends on the current state of the webpage in the browser? So far I couldn’t reproduce this (on Big Sur).

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 1:27pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/9 "2021-06-03T13:27:57Z")

</div>

Don‘t think so. After it started to fail in the past weeks I often keep the tab open. One of the next tries should work if it were that, I think.

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [June 3, 2021, 1:29pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/10 "2021-06-03T13:29:09Z")

</div>

I’m not seeing an issue with creating a PDF with the browser extension - paginated or one page - for that URL.

The browser extension reloads the page before clipping so some variability would not be unexpected.  
And the AppleScript command is also downloading content, so I don’t find the behavior unusual.

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 1:35pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/11 "2021-06-03T13:35:17Z")

</div>

> [@BLUEFROG](#):
>
> The browser extension reloads the page before clipping so some variability would not be unexpected.  
> And the AppleScript command is also downloading content, so I don’t find the behavior unusual.

Is there no mechanism built into the extension and the AppleScript command that makes sure that the content is fully loaded?

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [June 3, 2021, 1:37pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/12 "2021-06-03T13:37:52Z")

</div>

@cgrunenberg would have to respond on the AppleScript mechanism as I don’t know if it’s something similar to `curl` or `wget` or what.

From what I know of the browser extension, there is nothing that checks if the page is fully loaded. And even if it did, that’s still no guarantee as there are plenty of pages online that don’t load figures until you’ve scrolled to them.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [June 3, 2021, 1:39pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/13 "2021-06-03T13:39:45Z")

</div>

> [@pete31](#):
>
> Is there no mechanism built into the extension and the AppleScript command that makes sure that the content is fully loaded?

The task actually wait until no more data is loaded (plus a small delay). In case of dynamic websites loading stuff on demand/user interaction this might fail though (and some dynamic websites can even scroll endlessly).

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 1:40pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/14 "2021-06-03T13:40:42Z")

</div>

> [@BLUEFROG](#):
>
> that don’t load figures until you’ve scrolled to them.

Yes I understand that. But look at the captures in my first post. It‘s the title and the declaration that‘s missing, both at the top of the site. Isn‘t it strange that they‘re missing?

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 3, 2021, 1:44pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/15 "2021-06-03T13:44:31Z")

</div>

> [@cgrunenberg](#):
>
> In case of dynamic websites loading stuff on demand/user interaction this might fail

Yes, but the Apple Developer sites are no such sites, or? I don‘t see any dynamic content there, or is responsive design (I think of resizing elements) dynamic content?

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [June 3, 2021, 1:49pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/16 "2021-06-03T13:49:13Z")

</div>

> [@pete31](#):
>
> Yes, but the Apple Developer sites are no such sites, or?

The latest one is dynamic (see @chrillek’s reply). E.g. disable JavaScript and you will only get an error message:

 ![Bildschirmfoto 2021-06-03 um 15.48.49](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/6/f/6f0603a37b625ac6748c870f28e267d5ee12c6cb.jpeg)

---

<div class="post-metadata">

**Author:** ![Amontillado](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Amontillado](https://discourse.devontechnologies.com/u/Amontillado)\
**Post date:** [June 3, 2021, 1:49pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/17 "2021-06-03T13:49:21Z")

</div>

If I have the DT window fairly small when I click on the import button, DT won’t scan a full page. The cure is quit DT, restart, size the window “wide enough” and then click the import button.

When that happens, I see a partial page as in the example in this thread.

---

<div class="post-metadata">

**Author:** ![mdbraber](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mdbraber/32/5802_2.png) [@mdbraber](https://discourse.devontechnologies.com/u/mdbraber)\
**Post date:** [June 3, 2021, 1:55pm UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/18 "2021-06-03T13:55:52Z")

</div>

I’ve just spent a few nights figuring out how to capture Linkedin pages (also dynamically loaded content) to PDF. It’s a mess basically and you’ll have to resort to hacks to get some kind of result (and even that’s not reliable a 100% of the time). I’ll share my script when I’m happy with them, but you might want to take a look at @mhucka’s PDF capturing scripts (hacks) that incorporate some scrolling to get better PDF output: [devonthink-hacks/auto-convert-web-page-to-PDF at main · mhucka/devonthink-hacks · GitHub](https://github.com/mhucka/devonthink-hacks/tree/main/auto-convert-web-page-to-PDF)

---

<div class="post-metadata">

**Author:** ![mhucka](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/mhucka/32/28691_2.png) [@mhucka](https://discourse.devontechnologies.com/u/mhucka)\
**Post date:** [June 4, 2021, 3:11am UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/19 "2021-06-04T03:11:28Z")

</div>

> [@pete31](#):
>
> I would say possible, but that wouldn’t explain that it also happens via AppleScript.

Hmmm … I’m not so sure. If rendering a web page requires loading a lot of resources, some of which come from different domains than the parent page and from different CDNs, then it seems to me that no matter what mechanism you use to access the page, timing issues can come into play because they are due to factors outside of your computer. Also, different users around the world may see different elements appear at different times depending on their geographic location (which affects which CDN servers are reached), which can explain why different people see different results when they try to reproduce the problem.

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [June 4, 2021, 3:31am UTC](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901/20 "2021-06-04T03:31:22Z")

</div>

> [@mhucka](#):
>
> If rendering a web page requires loading a lot of resources, some of which come from different domains than the parent page and from different CDNs, then it seems to me that no matter what mechanism you use to access the page, timing issues can come into play because they are due to factors outside of your computer.

Makes sense. What I don’t get is that it depends on the method used:

> [@pete31](#):
>
> **Edit** : It seems to work reliably if the URL is first opened in DEVONthink. I captured 3 times with success from within DEVONthink and 3 times the same URL failed when captured from Safari.
> 
> **Edit 2** : It works from within DEVONthink with `Paginated PDF` but fails with `Clip to DEVONthink`

I used the same URL and did not reload it. It worked every time via `Paginated PDF` and failed via `Clip to DEVONthink`.

Edit: Ah, I think I got it:

> [@BLUEFROG](#):
>
> The browser extension reloads the page before clipping so some variability would not be unexpected.

Does that mean `Paginated PDF` takes the current DEVONthink tab’s source, i.e. it doesn’t reload? That would explain the difference.

@cgrunenberg If it’s a timing issue wouldn’t an AppleScript option that allows for a “delay” make sense?

[Next page](https://discourse.devontechnologies.com/t/is-capturing-pdfs-from-developer-apple-com-broken/64901.md?page=2)
