downloadPdfByType:(type = "") => { const data = { "employment_page":employment_page, "trust_and_will_page":trust_and_will_page, "power_of_attorney_page":powerAttorney, "life_insurance":life_Insurance, "safe_deposit_page":safe_deposit_page, "business_page":business_page, "jewelry-inventory":jewelry_inventory, "real_estate_page":real_estate, "letter_to_loved_ones":letter_to_loved_ones, "obituary_final_wishes_page":obituaryFinal, } if (data[type]){ const link = document.createElement('a'); link.href = data[type]; link.download = `${type}.pdf`; document.body.appendChild(link); link.click(); document.body.removeChild(link); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter