PageSourceSearch

https://pdftopng.vercel.app/assets/PptxToPdf-CMpqs8Zg.js

js pdftopng.vercel.app collected 2026-10-03 07:29:13 UTC 3,392 bytes, 1 lines download raw bytes

1import{u as L,o as e,d as N}from"./index-D7MwO683.js";import{r as R}from"./reactvendor-DlBOAdIn.js";import{u as k}from"./useFileUpload-BpPEElPY.js";import E from"./FileUploadArea-Dnp18xoA.js";import{a as l,c as $,t as i,d as A,p as x}from"./toast-_K5uaNnl.js";const O="https://pdftopng-rix0.onrender.com";function H(){const{addToHistory:u}=L(),b=R.useCallback(async a=>a&&["application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(a.type)?{isValid:!0,message:`File "${a.name}" selected (${(a.size/1024).toFixed(1)} KB)`}:{isValid:!1,message:"Please select a valid .pptx file."},[]),{file:t,loading:d,setLoading:c,isDragging:h,fileInputRef:w,dropAreaRef:g,handleFileChange:v,handleClear:P,handleDragEnter:y,handleDragOver:D,handleDragLeave:j,handleDrop:F,handleAreaClick:U}=k(b),C=async a=>{if(a.preventDefault(),!t){l("Please select a PPTX file first.");return}c(!0);const n=$(`Converting "${t.name}" to PDF...`),p=new FormData;p.append("file",t);try{const o=await fetch(`${O}/convertPptxToPdf`,{method:"POST",body:p});if(o.ok){const s=await o.blob(),f=window.URL.createObjectURL(s),r=document.createElement("a");r.href=f;const m=t.name.replace(/\.pptx$/i,".pdf");r.download=m,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(f),i(n),A("Your PDF has been downloaded!");const T=window.URL.createObjectURL(s);u({fileName:t.name,conversionType:"PPTX to PDF",downloadUrl:T,downloadName:m})}else{const s=await x(null,o);i(n),l(`Conversion failed: ${s}`)}}catch(o){i(n),l(await x(o))}finally{c(!1)}};return e.jsxs("div",{className:"w-full max-w-[700px] mx-auto p-10 text-center flex flex-col justify-center items-center theme-panel rounded-2xl overflow-hidden",children:[e.jsx("h1",{className:"mb-10 text-[var(--color-app-text)] text-5xl font-bold tracking-tight relative inline-block after:content-[''] after:absolute after:w-[60px] after:h-1 after:bg-gradient-to-r after:from-[#4361ee] after:to-[#7209b7] after:-bottom-2.5 after:left-1/2 after:-translate-x-1/2 after:rounded-sm",children:"PPTX to PDF"}),e.jsx("p",{className:"text-gray-500 text-sm mb-8 -mt-6",children:"Upload a .pptx file to convert it to PDF."}),e.jsxs("form",{onSubmit:C,className:"w-full flex flex-col items-center",children:[e.jsx(E,{file:t,isDragging:h,fileInputRef:w,dropAreaRef:g,handleFileChange:v,handleClear:P,handleDragEnter:y,handleDragOver:D,handleDragLeave:j,handleDrop:F,handleAreaClick:U,accept:".pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation",inputId:"pptx-pdf-input",defaultIcon:e.jsx(N,{className:"w-16 h-16"}),defaultText:"Upload a PPTX to convert",supportText:"Converts PowerPoint to PDF on the server"}),e.jsx("button",{type:"submit",disabled:!t||d,className:"bg-gradient-to-r from-[#4361ee] to-[#3b82f6] text-white py-3.5 px-8 border-none rounded-lg cursor-pointer text-lg font-semibold transition-all duration-300 shadow-[0_4px_12px_rgba(59,130,246,0.25)] tracking-wide w-full max-w-[300px] mx-auto hover:enabled:-translate-y-0.5 disabled:from-[#cbd5e1] disabled:to-[#e2e8f0] disabled:text-[#94a3b8] disabled:cursor-not-allowed disabled:shadow-none",children:d?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"inline-block w-5 h-5 border-[3px] border-[rgba(255,255,255,0.3)] rounded-full border-t-white animate-spin mr-2.5"}),"Converting..."]}):"Convert to PDF"})]})]})}export{H as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.