Skip to content

fix: respect explicit spreadsheet preview type#772

Open
SpencerZhang wants to merge 1 commit into
kekingcn:masterfrom
SpencerZhang:fix/xlsx-pdf-preview-routing
Open

fix: respect explicit spreadsheet preview type#772
SpencerZhang wants to merge 1 commit into
kekingcn:masterfrom
SpencerZhang:fix/xlsx-pdf-preview-routing

Conversation

@SpencerZhang

Copy link
Copy Markdown
Contributor

What changed

  • Track whether officePreviewType was explicitly supplied by the request or caller.
  • Respect explicit pdf, html, xlsx, and csv preview routing for spreadsheet files.
  • Preserve the existing default Web-preview behavior when no preview type is explicitly supplied.
  • Add focused unit tests for cache-target selection and Web-preview routing.

Why

When office.type.web=web, an explicit officePreviewType=pdf request for an xlsx file could still be routed to the xlsx Web preview. Spreadsheet cache naming was also decided before the request-level preview type was applied, so the generated artifact could disagree with the requested mode.

This change distinguishes an explicit request override from the configured default and applies it before selecting the cache target and preview page.

Impact

  • Explicit xlsx PDF requests now use the Office-to-PDF flow.
  • Explicit HTML requests continue to generate HTML previews.
  • Requests without an explicit preview type retain the existing xlsx/csv Web-preview behavior.

Validation

  • git diff --check
  • Added FileHandlerServiceTests and OfficeFilePreviewImplTests.
  • Targeted Maven tests could not run because com.aspose:aspose-cad:25.10 was unavailable from the configured Hzero Maven repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant