Repository: electron/electron (language: cpp)

Issue:
Print the document WebView The print - > PageSize document is ambiguous
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

![image](https://user-images.githubusercontent.com/39638510/155918554-ff390805-0e94-4e16-bc5e-ecc9ed631909.png)
![image](https://user-images.githubusercontent.com/39638510/155918561-6af614c3-5254-47bc-b73f-120fbe5a9da9.png)

The unit of width and height is not clear. I don't know whether it should be Px, cm or mm

### Proposed Solution

 hope you can clarify the unit data of what to wear

### Alternatives Considered

none

### Additional Information

_No response_


Discussion / hints:
It should be microns base on the below documentation.
![image](https://user-images.githubusercontent.com/4316597/156214968-6590ee36-0164-40d2-b059-d3a95937e3c7.png)

@JoeABCDEF  I think this might help.
![github1](https://user-images.githubusercontent.com/59815207/159575482-4d0f229e-2d6f-4560-8d60-df0b1c83eb54.PNG)
[https://www.electronjs.org/docs/latest/api/browser-view](url)


This issue requires addition of a unit to the height and width in the documentation.Right?  Should it be pixels or microns?
YouTube-Restrict: Strictสำรวจการเข้าใช
ความกว้างในเอกสารประกอบใช่ไหม ควรเป็นพิกเซลหรือไมครอน?

 
@google539 google539 แสดงความคิดเห็น
I'm trying to print to a 100x150mm sheet (similar to A6 and 4x6in but not identical). If I use `pageSize: { width: 105000, height: 148000 }` then I'm able to print but image it's all pixelated. If I don't specify size, printer gets an error and gets freezed. Then I need to turn off the printer and on later to be able to print.
Hey can anyone explain a little bit more about this issue. I couldn't understand it properly. Plz explain me.... Thanks
Can you Explain more about your problem?
We can try using all the units like(Px,cm,mm) and then check which is more accurate or more appealing and go for that unit
The documentation for `<webview>` tag here: [webview docs](https://www.electronjs.org/docs/latest/api/webview-tag#webviewprintoptions), states that the print() method is the same as the webContents module print() method. The documentation for that is here: [webContents docs](https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback) which states the following: `When a custom pageSize is passed, Chromium attempts to validate platform specific minimum values for width_microns and height_microns. Width and height must both be minimum 353 microns but may be higher on some operating systems.`

To answer your issue; the unit is microns.

Fix patch:
diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md
index c2eab361cfd94..865b101168ad6 100644
--- a/docs/api/webview-tag.md
+++ b/docs/api/webview-tag.md
@@ -556,7 +556,7 @@ Stops any `findInPage` request for the `webview` with the provided `action`.
   * `header` string (optional) - string to be printed as page header.
   * `footer` string (optional) - string to be printed as page footer.
   * `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A3`,
-  `A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`.
+  `A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` in microns.
 
 Returns `Promise<void>`
 


Test patch: