Skip to content

Commit 599a829

Browse files
authored
docs: add note about pictures in base64 format
1 parent cb4aa61 commit 599a829

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/inserting-pictures.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Creating pictures in Excel is a bit complicated, mostly due to the many, many di
88

99
OpenXML Drawings have an odd (understandable, but still odd) positioning system. Use the pixelsToEMUs method available in the Positioning.js to turn a pixel amount into EMU's, which is what is needed for any offset specification.
1010

11+
> **Note** Please note that pictures **must be provided as `base64` format**, you can look on the internet on how to do that or if you're using ViteJS then look at the Vite loader plugin at the end of this document.
12+
1113
```ts
1214
import { Drawings, ExcelBuilder, Picture, Positioning } from 'excel-builder-vanilla';
13-
import strawberryImageData from './images/strawberry.jpg?base64';
15+
import strawberryImageData from './images/strawberry.jpg?base64'; // using an optional Vite loader plugin
1416

1517
const fruitWorkbook = createWorkbook();
1618
const berryList = fruitWorkbook.createWorksheet({ name: 'Berry List' });
@@ -92,4 +94,4 @@ export default defineConfig({
9294
// ...
9395
plugins: [base64Loader],
9496
});
95-
```
97+
```

0 commit comments

Comments
 (0)