Use Cases
Images & CORS
Remote images must be accessible to the browser during rendering.
Images & CORS
Remote images must be accessible to the browser during rendering.
Recommended:
html2canvas: {
useCORS: true,
}
For external images:
- configure appropriate CORS headers
- avoid inaccessible authenticated image URLs
- prefer data URLs for critical logos when practical
- preserve image aspect ratio
Normal content image CSS:
.pdf-root img {
max-width: 100%;
height: auto;
object-fit: contain;
}
Header/footer logo sizing is already aspect-ratio-safe internally. Their width and height props define maximum bounds instead of forced image dimensions.
