PageSourceSearch

https://www.jukeboxprint.com/react/prod/DocumentToPdfPage-DLGVaa9G.js

js jukeboxprint.com collected 2026-09-24 17:21:36 UTC 13,712 bytes, 2 lines download raw bytes

1import{j as e}from"./client-BDJMow-F.js";import{r as n}from"./tabler-icons-development-DI2L2NPt.js";import{F as ae}from"./FAQSection-CsDzIwzj.js";import{E as le}from"./ExploreToolsSection-BO8ODazJ.js";import{R as ie}from"./RecaptchaInvisible-Bq4mK7eG.js";import{T as ce}from"./TrustpilotWidget-YnMos3dT.js";import{T as de}from"./ToolsBreadcrumb-CWvUAVzG.js";import{t as z}from"./toolTypeRoles.module-CRugzuNx.js";import{C as me}from"./check-BPArOp9j.js";import{D as ue}from"./download-BCnnU_Dn.js";import{R as $}from"./rotate-ccw-CMOsTBTs.js";import{W as pe}from"./wifi-off-DwJz-_vd.js";import{C as fe}from"./circle-alert-xn4NmiVy.js";import"./chevron-down-CeIlD8WT.js";import"./createLucideIcon-CBKpTRs4.js";import"./CloudinaryImage-B1iMtP-y.js";const xe="DocumentToPdfPage-module__root___CgAxk",ge="DocumentToPdfPage-module__heroMesh___U49DW",he="DocumentToPdfPage-module__dropZoneTitle___4AB8D",_e="DocumentToPdfPage-module__dropZone___sgPXY",ve="DocumentToPdfPage-module__dragging___3lUVj",je="DocumentToPdfPage-module__progressContainer___C2yUY",we="DocumentToPdfPage-module__progressFill___Yzbf-",Ne="DocumentToPdfPage-module__statusEngine___AvxWJ",Pe="DocumentToPdfPage-module__statusMsg___Gjp6u",ye="DocumentToPdfPage-module__active___S-lN3",be="DocumentToPdfPage-module__prev___53ZOW",Te="DocumentToPdfPage-module__errorContainer___-YQ8K",Ce="DocumentToPdfPage-module__errorBadge___1Hqas",ke="DocumentToPdfPage-module__critical___Mk5ju",De="DocumentToPdfPage-module__hiding___Srmnl",Ie="DocumentToPdfPage-module__workspaceCard___8dKqn",Se="DocumentToPdfPage-module__workspaceInner___PLVzJ",Ee="DocumentToPdfPage-module__fileInfo___WFnIk",Fe="DocumentToPdfPage-module__fileIcon___6483h",Re="DocumentToPdfPage-module__fileName___fx-t4",Oe="DocumentToPdfPage-module__fileSize___Yzams",Be="DocumentToPdfPage-module__successIcon___xzH35",Ae="DocumentToPdfPage-module__resetBtn___H1Vc4",Le="DocumentToPdfPage-module__heroTitle___W4nP0",s={root:xe,heroMesh:ge,dropZoneTitle:he,dropZone:_e,dragging:ve,progressContainer:je,progressFill:we,statusEngine:Ne,statusMsg:Pe,active:ye,prev:be,errorContainer:Te,errorBadge:Ce,critical:ke,hiding:De,workspaceCard:Ie,workspaceInner:Se,fileInfo:Ee,fileIcon:Fe,fileName:Re,fileSize:Oe,successIcon:Be,resetBtn:Ae,heroTitle:Le},U=!1,Me=[".doc",".docx",".xls",".xlsx",".ppt",".pptx",".jpg",".jpeg",".png",".gif",".bmp",".tiff",".webp",".svg",".txt",".rtf",".odt",".ods",".odp",".csv",".html",".htm",".md",".epub"],ze=50*1024*1024,N=["Reading your document","Converting to PDF format","Formatting pages","Optimizing output","Almost ready"],W={server_error:{message:"Something went wrong. Please try again.",isCritical:!0},network_error:{message:"Connection interrupted. Please try again.",isCritical:!0},rate_limit:{message:"Daily limit reached. Try again tomorrow.",isCritical:!1}},H=t=>W[t||"server_error"]||W.server_error;let j=null,k=0,D=0,I=!1,g=null;const X=[5e3,3e4,3e5],$e=t=>t<=X.length?X[t-1]:1/0,q=()=>{if(Date.now()<k)return Promise.resolve(null);if(j&&Date.now()<j.expiresAt)return Promise.resolve(j.token);if(g)return g;const r=document.getElementById("csrf")?.value||"";return g=(async()=>{try{const a=await fetch(`/api/tools/token?csrf=${encodeURIComponent(r)}`,{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!a.ok)return a.status===403&&!I?(I=!0,g=null,q()):(a.status===403&&(D++,k=Date.now()+$e(D)),g=null,null);const c=await a.json();return j={token:c.token,expiresAt:Date.now()+c.expires_in*1e3},k=0,D=0,I=!1,g=null,j.token}catch{return g=null,null}})(),g},Ue=t=>{const r=new URLSearchParams;return t.geoLocationIp&&r.set("ip",t.geoLocationIp),t.sessionId&&r.set("session_id",t.sessionId),t.customerId&&r.set("customer_id",String(t.customerId)),t.toolsEndpoint&&r.set("endpoint",t.toolsEndpoint),r.toString()},We=async(t,r)=>{const a=await q();if(!a)return null;const c=Ue(r),d=`https://tools.jukeboxprint.com/files/upload_document/${c?"?"+c:""}`,x=new FormData;x.append("file",t,t.name);try{const u=await fetch(d,{method:"POST",body:x,headers:{Authorization:`Bearer ${a}`}});if(!u.ok)return null;const p=await u.json();return p.uuid?p:null}catch{return null}},Z=t=>{const r=t.lastIndexOf(".");return r>=0?t.substring(r).toLowerCase():""},J=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,Y=({error:t,onDismiss:r})=>{const[a,c]=n.useState(!1),d=n.useRef(null),x=n.useCallback(()=>{a||(c(!0),setTimeout(()=>{r()},500))},[a,r]);if(n.useEffect(()=>{if(t&&!a)return d.current=setTimeout(x,6e3),()=>{d.current&&clearTimeout(d.current)}},[t,a,x]),n.useEffect(()=>{c(!1)},[t?.message]),!t)return null;const u=t.isCritical?pe:fe;return e.jsx("div",{className:s.errorContainer,children:e.jsxs("div",{className:`${s.errorBadge} ${t.isCritical?s.critical:""} ${a?s.hiding:""}`,onClick:x,role:"alert",children:[e.jsx(u,{className:"w-4 h-4 text-white flex-shrink-0"}),e.jsx("span",{className:"text-white",children:t.message})]})})},at=({toolsConfig:t,pageTitle:r="",pageDescription:a="",faqs:c=[],recaptchaSiteKey:d,tools:x=[]})=>{const[u,p]=n.useState("upload"),[G,P]=n.useState(!1),[l,S]=n.useState(null),[V,w]=n.useState(0),[E,y]=n.useState(0),[F,f]=n.useState(null),[b,R]=n.useState(""),_=n.useRef(null),T=n.useRef(null),[Q,K]=n.useState(!1);n.useEffect(()=>{K(!!d)},[d]),n.useEffect(()=>{const o=document.createElement("style");return o.id="doc-to-pdf-layout-fix",o.textContent=["html { overflow-x: hidden !important;
1 overflow-y: scroll !important; }","body { overflow: visible !important; }",".menu-slide-container, .menu-slide-container main { transition: none !important; }"].join(`
2`),document.head.appendChild(o),()=>{o.remove()}},[]);const O=async o=>{p("processing"),w(0),y(0),f(null);const i=setInterval(()=>{w(m=>m>=90?m:m+1.2)},100),h=setInterval(()=>{y(m=>(m+1)%N.length)},2200);try{if(!t)throw new Error("Tools config not available");const m=await We(o,t);if(!m)throw new Error("Upload failed");clearInterval(i),clearInterval(h),w(100),R(m.uuid),p("done")}catch{clearInterval(i),clearInterval(h),f(H("network_error")),p("failed")}},B=n.useCallback(o=>{if(!o||o.length===0)return;const i=o[0],h=Z(i.name);if(!Me.includes(h)){f({message:"Unsupported file type. Try DOC, DOCX, XLS, XLSX, PPT, PPTX, images, or text files.",isCritical:!0});return}if(i.size>ze){f({message:"File too large. Maximum size is 50MB.",isCritical:!0});return}f(null),S(i),_.current&&(_.current.value=""),O(i)},[t]),ee=n.useCallback(async()=>{if(!b||!l)return;let o="";if(T.current)try{o=await T.current.execute()}catch{f({message:"Security verification failed. Please try again.",isCritical:!0}),p("failed");return}try{const i=await fetch("/tools/doc-to-pdf/process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:b,recaptchaToken:o})}),h=i.headers.get("Content-Type")||"";if(!i.ok||h.includes("application/json"))throw new Error("download failed");const m=await i.blob();if(m.size===0)throw new Error("empty download");const re=l.name.replace(/\.[^.]+$/,""),M=URL.createObjectURL(m),v=document.createElement("a");v.href=M,v.download=`${re}.pdf`,document.body.appendChild(v),v.click(),setTimeout(()=>{v.remove(),URL.revokeObjectURL(M)},100)}catch{f(H("network_error")),p("failed")}},[b,l]),A=()=>{p("upload"),w(0),y(0),f(null),S(null),R("")},L=n.useCallback(()=>{f(null)},[]),te=o=>{o.preventDefault(),P(!0)},se=()=>{P(!1)},oe=o=>{o.preventDefault(),P(!1),B(o.dataTransfer.files)},ne={"@context":"https://schema.org","@type":"SoftwareApplication",name:"Free Document to PDF Converter | Jukebox",operatingSystem:"WEB",applicationCategory:"UtilitiesApplication",description:"Convert Word, Excel, PowerPoint, images, and other documents to PDF in seconds. Free, fast, and secure.",offers:{"@type":"Offer",price:"0.00",priceCurrency:"USD"},brand:{"@type":"Brand",name:"Jukebox"}},C=l?Z(l.name).replace(".","").toUpperCase():"";return e.jsxs("div",{className:`bg-white ${s.root}`,children:[e.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(ne)}}),e.jsxs("header",{className:"relative w-full pt-4 pb-12 md:pt-6 md:pb-16 px-4 md:px-6 flex flex-col items-center text-center overflow-hidden",children:[e.jsx("div",{className:"self-stretch -mx-4 md:-mx-6",children:e.jsx(de,{items:[{name:"Convert DOC to PDF",url:"https://www.jukeboxprint.com/tools/doc-to-pdf"}],className:"text-left"})}),e.jsx("div",{className:s.heroMesh}),e.jsxs("div",{className:"relative z-20 w-full max-w-5xl mb-6 md:mb-10",children:[e.jsx("h1",{className:`${s.heroTitle} mb-5 md:mb-8 px-2 mt-0`,children:r}),e.jsx("p",{className:"text-base md:text-xl text-gray-500 font-normal max-w-2xl mx-auto leading-relaxed px-4 font-inter",children:a})]}),e.jsxs("div",{className:"relative z-50 w-full max-w-4xl mx-auto pb-6",children:[u==="upload"&&e.jsx("div",{className:"px-2 transition-all duration-500",children:e.jsx("div",{className:`${s.dropZone} ${G?s.dragging:""} py-12 md:py-16 px-6 md:px-10 group`,onClick:()=>_.current?.click(),onDragOver:te,onDragLeave:se,onDrop:oe,children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("h3",{className:`${s.dropZoneTitle} mb-2 pointer-events-none`,children:"How to Convert DOC to PDF"}),e.jsx("p",{className:"text-gray-500 font-normal mb-8 text-xs md:text-sm pointer-events-none",children:"Upload your Word document, click convert, and download your new PDF in seconds. The formatting from your original document stays intact so the final PDF looks exactly the same."}),e.jsx("div",{className:"pointer-events-auto w-full",children:e.jsx(Y,{error:F,onDismiss:L})}),e.jsx("button",{type:"button",className:"jb-btn btn-black !px-12 !py-4 md:!px-16 md:!py-5 text-base md:text-lg mb-8 w-full sm:w-auto pointer-events-auto",disabled:U,onClick:o=>{o.stopPropagation(),_.current?.click()},children:"Select Word Files"}),e.jsxs("div",{className:"max-w-md mx-auto text-center sm:px-4 pointer-events-none",children:[e.jsxs("p",{className:"text-[8px] sm:text-[10px] text-gray-900 font-normal leading-relaxed tracking-normal",children:["By uploading a document you agree to our ",e.jsx("a",{href:"/terms-and-conditions",target:"_blank",rel:"noopener noreferrer",className:"underline pointer-events-auto",onClick:o=>o.stopPropagation(),children:"terms of service"}),"."]}),d&&e.jsxs("p",{className:"text-[8px] sm:text-[10px] text-gray-900 font-normal leading-relaxed tracking-normal",children:["This site is protected by reCAPTCHA and the Google ",e.jsx("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline pointer-events-auto",onClick:o=>o.stopPropagation(),children:"privacy policy"})," apply."]})]})]})})}),u==="processing"&&l&&e.jsx("div",{className:"px-2",children:e.jsx("div",{className:s.workspaceCard,children:e.jsxs("div",{className:s.workspaceInner,children:[e.jsxs("div",{className:s.fileInfo,children:[e.jsx("div",{className:s.fileIcon,children:C||"FILE"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:s.fileName,children:l.name}),e.jsx("div",{className:s.fileSize,children:J(l.size)})]})]}),e.jsx("div",{className:s.progressContainer,children:e.jsx("div",{className:s.progressFill,style:{width:`${V}%`}})}),e.jsx("div",{className:s.statusEngine,children:N.map((o,i)=>e.jsx("div",{className:`${s.statusMsg} ${i===E?s.active:i===(E-1+N.length)%N.length?s.prev:""}`,children:o},o))})]})})}),u==="done"&&l&&e.jsx("div",{className:"px-2",children:e.jsx("div",{className:s.workspaceCard,children:e.jsxs("div",{className:s.workspaceInner,children:[e.jsx("div",{className:s.successIcon,children:e.jsx(me,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-lg font-semibold font-dm-sans text-gray-900",children:"Your PDF is ready!"}),e.jsxs("div",{className:s.fileInfo,children:[e.jsx("div",{className:s.fileIcon,style:{background:"#ef4444"},children:"PDF"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:s.fileName,children:[l.name.replace(/\.[^.]+$/,""),".pdf"]}),e.jsxs("div",{className:s.fileSize,children:["Converted from ",C]})]})]}),e.jsxs("button",{type:"button",className:"jb-btn btn-black !px-12 !py-4 text-base w-full sm:w-auto",onClick:ee,children:[e.jsx(ue,{className:"w-5 h-5 mr-2"}),"Download PDF"]}),e.jsxs("button",{type:"button",className:s.resetBtn,onClick:A,children:[e.jsx($,{className:"w-3.5 h-3.5"}),"Convert another"]})]})})}),u==="failed"&&e.jsx("div",{className:"px-2",children:e.jsx("div",{className:s.workspaceCard,children:e.jsxs("div",{className:s.workspaceInner,children:[e.jsx(Y,{error:F,onDismiss:L}),l&&e.jsxs("div",{className:s.fileInfo,children:[e.jsx("div",{className:s.fileIcon,children:C||"FILE"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:s.fileName,children:l.name}),e.jsx("div",{className:s.fileSize,children:J(l.size)})]})]}),e.jsx("button",{type:"button",className:"jb-btn btn-black !px-10 !py-3 text-sm",onClick:()=>l&&O(l),children:"Try again"}),e.jsxs("button",{type:"button",className:s.resetBtn,onClick:A,children:[e.jsx($,{className:"w-3.5 h-3.5"}),"Start over"]})]})})}),e.jsx("input",{ref:_,type:"file",className:"hidden",accept:".doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.webp,.svg,.txt,.rtf,.odt,.ods,.odp,.csv,.html,.htm,.md,.epub",disabled:U,onChange:o=>B(o.target.files)})]})]}),e.jsx(ce,{variant:"microCombo",className:"py-4 my-4 bg-white"}),e.jsx(le,{tools:x,headingClassName:z.toolsGridHeading}),c.length>0&&e.jsx(ae,{faqs:c,title:"Common Questions.",titleClassName:z.faqHeading,includeSc
2hema:!0,schemaId:"https://www.jukeboxprint.com/tools/doc-to-pdf#faq",className:"bg-white",isHtmlContent:!0}),e.jsx("footer",{className:"w-full py-16 bg-white border-t border-gray-100"}),Q&&d&&e.jsx(ie,{ref:T,siteKey:d})]})};export{at 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.