How to create a single-page PDF from a web archive?

How do you create a single-page PDF from a web archive using AppleScript? I’m trying to accomplish the same thing as clicking this contextual menu item:

The following command only appears to accept URLs:

create PDF document from v : Create a new PDF document with or without pagination from a web resource.

create PDF document from text : The URL to download.

[agent text] : The user agent.

[in record] : The destination group for the new record. Uses incoming group or group selector if not specified.

[name text] : The name for the new record.

[pagination boolean] : Paginate PDF document or not.

[readability boolean] : Declutter page layout.

[referrer text] : The HTTP referrer.

[width integer] : The preferred width for the PDF document in pixels.

→ record

Records, tabs, and think windows all have a paginated PDF property but not a single-page PDF property:

paginated PDF (any, r/o) : A printed/converted PDF of the record.

Tabs and think windows appear to have an unpaginated PDF property:

PDF (any, r/o) : A PDF without pagination of the visible document retaining the screen layout.

Is this what I’m looking for? It seems odd that this this is a property of a tab or a window but not of a record itself.

Update: It appears that the convert command can create PDFs:

convert v : Convert a record to plain or rich text, formatted note or HTML and create a new record afterwards.


record record : The record to convert.

[in record] : The destination group for the converted record. Parents of the record to convert are used if not specified.

[to html/‌markdown/‌note/‌PDF document/‌PDF without annotations/‌rich/‌simple/‌webarchive] : The desired format (default simple).

→ record

Unfortunately, this will create a paginated PDF document. Any other ideas?

You could use this command and use the URL of the web archive.

Conversion to single page PDF documents isn’t supported, neither via AppleScript nor via the user interface.

That can’t be true—I convert web archives to single-page PDF documents via the following contextual menu all the time.

I just want to find a way to automate the process of selecting PDF (One Page).

This clips the current page in various formats but it doesn’t convert selected documents.