I am generating pdf from html & sending it through API in formData but when I open saved file some underline and strike through text are not proper

Here is Some javascript and above it HTML code

`<div id='pdfContent'\>
<p>This is underlined text.</p>
<h1>Sample PDF Content</h1>
<p>This is strikethrough text.</p>
<h1>Sample PDF Content</h1>
<p>This is <del>strikethrough</del> text.</p>
<hr />
<p>This is some text after a horizontal rule.</p>

JAVASCRIPT CODE
const element1 = document.getElementById('pdfContent');
const options1 = {
html2canvas: {  useCORS: true, letterRendering: true },
jsPDF: { orientation: 'portrait', unit: 'pt', format: 'a4', compressPDF: true },
};
html2pdf().set(options1).from(element1).toPdf().get('pdf').then((pdfObj) =\> {
const perBlob = pdfObj.output('blob');
var formData = new FormData();
formData.append('pdf', perBlob, pdfName);
Temp(formData);//function
}).catch(err =\> {
console.error('Error generating PDF:', err);
});
const Temp = async (formData) =\> {
const res = await UploadPDF(Id, formData);
}`

Facing issue while checking saved pdf and viewing it css issue

Upvotes: 0

Views: 17

Answers (0)

Related Questions