Skip to main content

Hi everyone, 

 

I created a lwc to view the pdf which I stored in the static resource. It works but shows pdf in a narrow component. How can I make the component longer? The static Resource name is FCSSManagerHelp. Below is my current code. I am also attaching the screenshot of the component. 

 

I tried to change the height below but didn't work. Any idea? 

 

Thanks so much!

 

----------------

<template>

 <iframe src={SamplePDFURL} height="100%" width="100%"></iframe>

</template>

 

-------------

import { LightningElement } from 'lwc';

import FCSSManagerHelp from '@salesforce/resourceUrl/FCSSManagerHelp';

export default class fcssManagerHelp extends LightningElement {

    SamplePDFURL = FCSSManagerHelp;

}

3 respostas
  1. 24 de mai. de 2023, 14:29

    Thank you very much @Rakesh Kumar Samal and @Govind Gupta. I tried iframe, it didn't work but instead of 100%,  below width and height values worked.

     

    <template>

     <iframe src={SamplePDFURL} width="1250" height="700"></iframe>

    </template> 

0/9000