|
10 | 10 | import { |
11 | 11 | Scroller, |
12 | 12 | ScrollPluginPackage, |
| 13 | + ScrollStrategy, |
13 | 14 | type RenderPageProps |
14 | 15 | } from '@embedpdf/plugin-scroll/svelte'; |
15 | 16 | import { |
|
54 | 55 | initialDocuments: [{ url: asset('using-lemniscate-editor.pdf') }] |
55 | 56 | }), |
56 | 57 | createPluginRegistration(ViewportPluginPackage), |
57 | | - createPluginRegistration(ScrollPluginPackage), |
| 58 | + createPluginRegistration(ScrollPluginPackage, { |
| 59 | + defaultStrategy: ScrollStrategy.Vertical |
| 60 | + }), |
58 | 61 | createPluginRegistration(RenderPluginPackage), |
59 | 62 | createPluginRegistration(PrintPluginPackage), |
60 | 63 | createPluginRegistration(ExportPluginPackage), |
61 | 64 | createPluginRegistration(ZoomPluginPackage, { |
62 | 65 | defaultZoomLevel: ZoomMode.FitPage, |
63 | 66 | }), |
64 | | - /*createPluginRegistration(SpreadPluginPackage, { |
| 67 | + createPluginRegistration(SpreadPluginPackage, { |
65 | 68 | defaultSpreadMode: SpreadMode.None |
66 | | - }),*/ |
| 69 | + }), |
67 | 70 | createPluginRegistration(FullscreenPluginPackage), |
68 | 71 | createPluginRegistration(TilingPluginPackage, { |
69 | 72 | tileSize: 768, |
|
129 | 132 | <DocumentContent {documentId}> |
130 | 133 | {#snippet children(documentContent)} |
131 | 134 | {#if documentContent.isLoaded} |
132 | | - {#snippet renderPage(page: RenderPageProps)} |
133 | 135 | <div |
134 | | - style:width='{page.width}px' |
135 | | - style:height='{page.height}px' |
| 136 | + style:width='100%' |
| 137 | + style:height='100%' |
136 | 138 | style:position='relative' |
137 | 139 | > |
138 | | - <RenderLayer |
139 | | - {documentId} |
140 | | - pageIndex={page.pageIndex} |
141 | | - scale={1.0} |
142 | | - /> |
143 | | - <TilingLayer |
144 | | - {documentId} |
145 | | - pageIndex={page.pageIndex} |
146 | | - /> |
| 140 | + <Viewport {documentId} style={$SettingsStore.theme === 'dark' ? 'background-color:#2E3235' : 'background-color:#FFFFFF'}> |
| 141 | + <Scroller {documentId}> |
| 142 | + {#snippet renderPage(page: RenderPageProps)} |
| 143 | + <RenderLayer |
| 144 | + {documentId} |
| 145 | + pageIndex={page.pageIndex} |
| 146 | + scale={1.0} |
| 147 | + /> |
| 148 | + <TilingLayer |
| 149 | + {documentId} |
| 150 | + pageIndex={page.pageIndex} |
| 151 | + /> |
| 152 | + {/snippet} |
| 153 | + </Scroller> |
| 154 | + <PDFPluginLoader |
| 155 | + bind:activeDocument |
| 156 | + bind:docManager |
| 157 | + bind:exportApi |
| 158 | + bind:fullscreen |
| 159 | + bind:print |
| 160 | + bind:spread |
| 161 | + bind:zoom |
| 162 | + {documentId} |
| 163 | + /> |
| 164 | + </Viewport> |
147 | 165 | </div> |
148 | | - {/snippet} |
149 | | - <PDFPluginLoader |
150 | | - bind:activeDocument |
151 | | - bind:docManager |
152 | | - bind:exportApi |
153 | | - bind:fullscreen |
154 | | - bind:print |
155 | | - bind:spread |
156 | | - bind:zoom |
157 | | - {documentId} |
158 | | - /> |
159 | | - <Viewport {documentId} style={$SettingsStore.theme === 'dark' ? 'background-color:#2E3235' : 'background-color:#FFFFFF'}> |
160 | | - <Scroller {documentId} {renderPage} /> |
161 | | - </Viewport> |
162 | 166 | {/if} |
163 | 167 | {/snippet} |
164 | 168 | </DocumentContent> |
|
0 commit comments