Document scanning is possible via the Google Drive app, but my brain is not thinking of opening a cloud storage app to scan a document. I usually just open the camera app and take a photo instead – and apparently I'm not the only one.
Google has added a function to the camera app of the Pixel 4 that allows you to scan documents without taking a photo. Once it detects documents (a sheet of paper, business card, etc.), it offers to scan the document. Once scanned, you can then share it with a cloud service or with others via email or a messaging app. We have tested this feature on both the Google Pixel 3 and 3 XL without results, so it seems to be limited to the Google Pixel 4 and 4 XL for now.
Open the camera app, line up the viewfinder with a document that you want to scan. You want to be in a reasonably well-lit room so that the camera can identify the document. You also want to get as close to the item as possible while keeping the edges within the viewfinder.
A button appears asking if you want "Scan Document". Tap this button and after a second (or two) you will be redirected to a new page where Google Lens will display a grid where it thinks that the edge of the documents is. You can adjust the angles by dragging the circles and lines to match the edges of the document.
After you have finished editing, select "Done" in the lower left of the screen. Two new buttons appear: "PDF sharing" and "Image sharing". The first converts the scanned document into a PDF that you can share with other apps, including cloud services (where you can save it) or messaging app (where you send it to someone). The latter offers the same sharing options, but converts the scanned document into an image file.