Convert OneNote Document
The Convert OneNote Document action converts a OneNote (.one) file to another format and returns the resulting file content.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Document | File content | Yes | OneNote (.one) file content (for example, the output of a Get file content action from SharePoint or OneDrive). |
| Output Format | String | Yes | Desired target format. One of: PDF, HTML, JPEG, PNG, BMP, GIF, TIFF. |
Optional Parameters by Output Format
BMP
| Parameter | Type | Description |
|---|---|---|
| Resolution | Integer | Resolution for the generated images, in dots per inch (DPI). |
| Page Index | Integer | 0‑based index of the first page to render. |
GIF
| Parameter | Type | Description |
|---|---|---|
| Resolution | Integer | Resolution for the generated images, in dots per inch (DPI). |
| Page Index | Integer | 0‑based index of the first page to render. |
HTML
| Parameter | Type | Description |
|---|---|---|
| Page Count | Integer | Number of pages to render. |
| Page Index | Integer | 0‑based index of the first page to render. |
JPEG
| Parameter | Type | Description |
|---|---|---|
| Resolution | Integer | Resolution for the generated images, in dots per inch (DPI). |
| Page Index | Integer | 0‑based index of the first page to render. |
| Parameter | Type | Description |
|---|---|---|
| Image Compression | Enum | Compression algorithm for embedded images: Auto, Flate, Jpeg, none. |
| Image Quality | Integer | Quality setting for JPEG images inside the PDF. |
| Page Count | Integer | Number of pages to render. |
| Page Index | Integer | 0‑based index of the first page to render. |
PNG
| Parameter | Type | Description |
|---|---|---|
| Resolution | Integer | Resolution for the generated images, in dots per inch (DPI). |
| Page Index | Integer | 0‑based index of the first page to render. |
TIFF
| Parameter | Type | Description |
|---|---|---|
| Resolution | Integer | Resolution for the generated images, in dots per inch (DPI). |
| Page Index | Integer | 0‑based index of the first page to render. |
Returns
| Name | Type | Description |
|---|---|---|
| File content | String (base64‑encoded) | Base64‑encoded bytes of the converted file. If Output Format = HTML, returns the rendered HTML string. |
Troubleshooting
Click to expand common errors and fixes
Document Missing or Invalid
Cause:
Document input is empty, truncated, or not a valid .one file.
Fix:
- Provide the complete
.onebinary/base64 payload. - Verify the payload decodes to a valid OneNote file before conversion.
Unsupported or Misspelled Output Format
Cause:
Output Format string is incorrect or not supported.
Fix:
- Confirm the format name is exactly one of the supported values (e.g.,
PDF,PNG). - Correct typos and retry.
Password-Protected or Encrypted OneNote File
Cause:
File is encrypted or requires a password to open.
Fix:
- Supply an unprotected copy.
- Remove encryption before conversion.
Page Index / Page Count Out of Range
Cause:
Requested Page Index or Page Count does not exist in the document.
Fix:
- Verify page numbering is 0-based and within the document’s page range.
- If unsure, omit paging options to render the default full range or query the document page count first.
Resolution / DPI or Image Quality Issues
Cause:
Invalid or extreme resolution values, or inappropriate image quality/compression settings.
Fix:
- Use sensible DPI values (e.g., 72–300) and valid compression/quality enums.
- Test settings with a small sample page to gauge quality and file size.
Output Appears Corrupted or Will Not Open
Cause:
Output payload truncated, incorrectly encoded, or invalid for the chosen format.
Fix:
- Confirm the returned payload is a complete base64 string and decodes successfully.
- Re-run with a small
.onefile to validate end-to-end behavior.
Missing Content, Images or Attachments Not Rendered
Cause:
Embedded resources inside the OneNote file were not accessible or not supported by the chosen output format.
Fix:
- Verify the OneNote file contains embedded resources in supported formats.
- Use a different output format if certain embedded item types are unsupported.
Large File Performance, Timeouts, or Resource Limits
Cause:
Very large OneNote files or high-resolution rendering exhaust processing limits.
Fix:
- Limit page range, reduce requested DPI, or convert fewer pages at a time.
- Test with smaller content to determine safe limits.
Invalid Format-Specific Option Values
Cause:
Enum values, numeric ranges, or option combinations are invalid for the selected format (e.g., negative DPI, out-of-range quality).
Fix:
- Validate option values and ranges (e.g., Page Count and Page Index are non-negative integers).
- Remove conflicting options and retry.
HTML vs Binary Mismatch
Cause:
Expecting base64 binary when Output Format = HTML, or vice versa.
Fix:
- If HTML is selected, expect a rendered HTML string.
- For other formats, expect base64. Handle each output type accordingly.
Generic Runtime or Transient Failure
Cause:
Malformed inputs, transient internal error, or unexpected internal state.
Fix:
- Reproduce the issue with a minimal
.onefile and minimal options. - Validate all inputs (binary, format string, numeric option ranges) and retry to rule out transient failures.
Quick Checklist
- Document is a complete
.onebinary/base64 payload (not a path or URL). - Output Format matches one of the supported strings exactly.
- Paging options (
Page Index,Page Count) are 0-based and within range. - Resolution/DPI and image quality values are sensible and within allowed ranges.
- File is not password protected or corrupted.
- Test with a minimal sample page to confirm conversion settings before scaling up.
- For failures, reproduce with a minimal file and the exact option set used - that input set is necessary to isolate the issue.