The LWC file preview is not compatible with community: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/use_open_files
I tried this alternative:
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url:baseURL + '/sfc/servlet.shepherd/version/renditionDownload?
rendition=SVGZ&versionId='+contentversionId,
}
},false)
This opens the file in new tab and not in a the same page like the Salesforce standard preview. It displays only the first page of the document
I tried also this alternative:
<div class="close-icon" onclick={closeFile}></div>
<iframeclass="slds-file slds-file_card frame" src={fileURL}></iframe>
<div class="backdrop" onclick={closeFile}></div>
fileURL=baseURL + '/sfc/servlet.shepherd/version/renditionDownload?rendition=SVGZ&versionId='+contentversionId
This opens the file in the same page as I want but displays only the first page of the document.