intercept blob and encode to base64 string for file explorer

pull/3321/head^2
Joseph Izang 2 years ago committed by Aniket
parent 02b49144e1
commit 20faca48d4
  1. 9
      libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx

@ -218,10 +218,11 @@ export const ContractSelection = (props: ContractSelectionProps) => {
const domParser = new DOMParser() const domParser = new DOMParser()
const element = domParser.parseFromString(payload, 'image/svg+xml').querySelector('svg') const element = domParser.parseFromString(payload, 'image/svg+xml').querySelector('svg')
const fileName = `${api.currentFile.split('/')[0]}/resources/${api.currentFile.split('/')[1]}.pdf` const fileName = `${api.currentFile.split('/')[0]}/resources/${api.currentFile.split('/')[1]}.pdf`
// domToPdf(element, { filename: fileName}, function(pdf) {
// console.log({ pdf }) pdfBuilder.addSvgAsImage(payload, 1.6, 1.6, 300, 300)
// }); const result = pdfBuilder.output('datauristring', { filename: fileName })
pdfBuilder api.writeFile(fileName, result)
console.log({ result })
setSVGPayload(payload) setSVGPayload(payload)
setShowViewer(!showViewer) setShowViewer(!showViewer)
} catch (error) { } catch (error) {

Loading…
Cancel
Save