diff --git a/packages/api/src/files/documents/html.spec.ts b/packages/api/src/files/documents/html.spec.ts
index 8ed4293eb0..e23ba85781 100644
--- a/packages/api/src/files/documents/html.spec.ts
+++ b/packages/api/src/files/documents/html.spec.ts
@@ -632,6 +632,52 @@ describe('Office HTML producers', () => {
* on resize never measures an already-transformed box. */
expect(html).toContain('lcNativeW');
});
+
+ test('initializes pptx-preview with only a width so it never boxes the deck into a fixed-height viewport', async () => {
+ /* Passing `height` bounded the librarys own render box, which
+ * produced a nested scroll region for multi-slide decks instead
+ * of letting the panel itself scroll to the last slide. Width
+ * alone is enough — the wrap+scale step above fits each slide
+ * to the panel. */
+ const pptx = await buildPptx([{ title: 'A' }]);
+ const html = await _internal.pptxToHtmlViaCdn(
+ pptx,
+ '
- fb
',
+ );
+ expect(html).toContain('pptxPreview.init(container, { width: SLIDE_W })');
+ expect(html).not.toContain('height: SLIDE_H');
+ });
+
+ test('wraps each rendered slide directly instead of the containers immediate children', async () => {
+ /* pptx-preview nests every `.pptx-preview-slide-wrapper` inside
+ * one library-owned `.pptx-preview-wrapper` box, so
+ * `container.children` only ever finds that single box —
+ * wrapping it as one unit jammed every slide into one shared
+ * block. Querying `.pptx-preview-slide-wrapper` directly finds
+ * each slide wherever the library actually nested it, and each
+ * wrap is inserted next to its own slide via `slide.parentNode`
+ * rather than `container`. */
+ const pptx = await buildPptx([{ title: 'A' }, { title: 'B' }]);
+ const html = await _internal.pptxToHtmlViaCdn(
+ pptx,
+ '- fb
',
+ );
+ expect(html).toContain("container.querySelectorAll('.pptx-preview-slide-wrapper')");
+ expect(html).not.toContain('container.children');
+ expect(html).toContain('slide.parentNode.insertBefore(wrap, slide)');
+ });
+
+ test('overrides the librarys own wrapper box to hug the stacked slides width with a transparent background', async () => {
+ const pptx = await buildPptx([{ title: 'A' }]);
+ const html = await _internal.pptxToHtmlViaCdn(
+ pptx,
+ '- fb
',
+ );
+ expect(html).toMatch(/\.pptx-preview-wrapper\s*\{[^}]*width:\s*auto\s*!important/);
+ expect(html).toMatch(
+ /\.pptx-preview-wrapper\s*\{[^}]*background:\s*transparent\s*!important/,
+ );
+ });
});
describe('OFFICE_PREVIEW_DISABLE_CDN escape hatch', () => {
diff --git a/packages/api/src/files/documents/html.ts b/packages/api/src/files/documents/html.ts
index bf5e843e7e..3b54c010f5 100644
--- a/packages/api/src/files/documents/html.ts
+++ b/packages/api/src/files/documents/html.ts
@@ -1103,6 +1103,12 @@ function buildPptxCdnDocument(base64: string, slideListFallbackBody: string): st