This release fixes the reported PPTX error ("Invalid or corrupted PDF file" when uploading a PowerPoint) and about 15 other defects in OfficeToHtml_Reactive. Existing apps keep working without changes.
It also adds two optional features: viewing Binary Data and forcing a file type. Clear error messages now replace blank viewers. Every public element now has a meaningful description, and the demo app was redesigned.
PPTX upload failed with "Invalid or corrupted PDF file". The embedded PDF.js viewer listened to every file input on the page and never stopped. After one PDF had been shown, the next PPTX, DOCX or XLSX upload was opened as a PDF. It also kept listening after the user left the screen. PDF.js now only handles its own "Open file" button, and its listeners are released when another file type is shown or the block is destroyed.
Area
Problem
Fix
File picker
Cancelling the file dialog threw a JavaScript error
Cancel is ignored; the current preview stays
Re-initialisation
Each re-init added another upload handler
Handlers are namespaced and replaced, not stacked
Memory
Blob URLs of picked files were never released
Previous URL is revoked on each new file and on destroy
Multiple viewers
Every instance used the hard-coded input id grv, so viewers interfered
grv
Each instance gets a unique input id; a custom InputObjId is still respected
Parameter changes
Changing OptionalConfiguration at runtime was ignored
Block re-renders on change and skips it when nothing changed
Keyboard
PDF.js shortcuts stayed active on other screens
Released with the viewer
URLs
file.pptx?token=… was not recognised as PPTX
file.pptx?token=…
Query strings and fragments are ignored when detecting the type
DOCX
Load or conversion errors were uncaught; viewer stayed blank
Message shown in the viewer
Spreadsheets
Network or parse errors were uncaught
Message shown in the viewer, including HTTP status
PPTX
Corrupt files or failed downloads were uncaught
DOCX RTL
IsRtl only worked with Boolean values the Text attribute could not pass
Accepts "rtl", "ltr" and "auto"
Element ids
Math.floor() produced NaN in generated ids
Math.floor()
NaN
Uses Math.random()
Math.random()
PDF.js path
Crashed if the pdf.js script tag was not found
Guarded with a fallback
Console
Settings and paths were logged on every load
Debug logging removed
All additions are optional; existing apps don't need to change anything.
Element
Type
What it does
OfficeToHtmlConfig.FileType
Structure attribute (Text)
Forces the viewer to use a file type (e.g. "pdf") when the url has no extension
OfficeToHtml_CreateFileUrl
Public client action
Turns Binary Data (e.g. from the database) into a browser URL the viewer can show; file type is read from FileName
OfficeToHtml_RevokeFileUrl
Releases a URL created by OfficeToHtml_CreateFileUrl to free browser memory
OnParametersChanged handler
Block behaviour
Viewer reloads when OptionalConfiguration changes at runtime
OnDestroy handler
Releases listeners and URLs when the block leaves the screen
In-viewer error messages
Missing, unreachable or corrupt files show a readable message instead of a blank area
To show a file stored as Binary Data:
OptionalConfiguration.url
The release is backward compatible: no public element was renamed or removed, and no data type changed. Existing screens keep their current behaviour.
Nothing else is required. To use the new features, see New features above.
The demo was redesigned with a glassmorphism red-and-black theme, written as classes in the theme stylesheet (no inline styles) and responsive down to phone width. The footer "Made with ❤️ using OutSystems." is in the layout, so it shows on every screen.
Screen
What it shows
Home (new)
Overview, a tile per demo, how to use, supported formats
Upload
File picker preview plus the GetFile event output (file name, type, count)
PDF
PDF.js viewer with Open file and Bookmark buttons hidden through PdfSetting
Word
DOCX with IgnoreEmptyParagraphs
PowerPoint
PPTX in slide mode
Excel
Workbook with search and read-only mode
Image
Image with the rotate toolbar
Errors (new)
Unsupported file, legacy .doc and missing file side by side
Each viewer page shows a full-width live preview, the exact OptionalConfiguration used, and what to try. The demo previously pointed at one cloud environment (personal-l9q0mrdp.outsystemscloud.com); sample files are now loaded with GetOwnerURLPath(), so it works in any environment.
GetOwnerURLPath()
Bug Fix
.pptx
Cannot read properties of null - 'asText'
readXmlFile
Compatibility
Enhanced File Support
Added support for the following file types in the file input:
PDF (.pdf)
Word Documents (.docx)
PowerPoint Presentations (.pptx)
Excel Sheets (.xls, .xlsx)
Images (JPG, PNG, etc.)
HTML input Element now uses:
input
<input type="file" accept=".pdf, .docx, .pptx, .xls, .xlsx, image/*" />
UI Improvements (Demo Application)
Redesigned the Demo UI for a cleaner, more attractive look and better user experience.
Updated layout, icons, and styling for improved visual appeal and usability.