PageSourceSearch

https://www.ondevicepdf.com/_next/static/chunks/963.35fb4f9c9cb1d78b.js

js ondevicepdf.com collected 2026-09-24 14:50:01 UTC 11,949 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[963],{60963:(e,s,t)=>{t.r(s),t.d(s,{default:()=>N});var r=t(95155),a=t(12115),i=t(89342),o=t(11363),n=t(79397),l=t(90450),c=t(93489),d=t(77953),m=t(92517),g=t(2527),p=t(57423),x=t(73584),h=t(76130),b=t(76871),u=t(19253),f=t(9928),j=t(52998),y=t(44223);function N(){let[e,s]=(0,a.useState)([]),[t,N]=(0,a.useState)(!1),[v,P]=(0,a.useState)(!1),[F,D]=(0,a.useState)(`images-${new Date().toISOString().slice(0,10)}.pdf`),[w,k]=(0,a.useState)({visible:!1,message:"",type:"success"}),[C,S]=(0,a.useState)(""),[E,R]=(0,a.useState)(null),[G,I]=(0,a.useState)(!1),$=(0,a.useRef)(e);async function A(e){if(!(0,u.E5)(e))return{file:e,name:e.name,url:URL.createObjectURL(e)};let s=await (0,u.Zo)(e);return{file:s,name:s.name,url:URL.createObjectURL(s)}}async function U(e){P(!0);try{let t=[];for(let s of e)t.push(await A(s));s(e=>[...e,...t])}catch(e){console.error("Failed to import images",e),k({visible:!0,message:e?.message||"Failed to import one or more images.",type:"error"})}finally{P(!1)}}async function L(){if(0!==e.length){N(!0);try{let s=await i.UL.create(),t=[],r=0;for(let a=0;a<e.length;a++){let{file:i}=e[a];S(`Adding image ${a+1} of ${e.length}…`);try{await (0,u.aX)(s,i),r++}catch(e){console.error(`[ImageToPDF] Failed to add ${i.name}:`,e),t.push(i.name)}}if(0===r)throw Error("None of the images could be read. Supported formats: JPG, PNG, WebP, GIF, BMP, HEIC.");let a=await s.save(),o=new Blob([a],{type:"application/pdf"}),n=F||"images.pdf",l=new File([o],n,{type:"application/pdf"});await (0,j.O)(o,n);let c=(0,h.H)("convert-image-to-pdf");((0,b.RZ)()||c?.isStartStep)&&(await (0,b.ic)(l,n),c?.isStartStep&&I(!0)),t.length>0?k({visible:!0,message:`PDF created with ${r} image${r>1?"s":""}. ⚠️ Skipped ${t.length} unreadable: ${t.slice(0,3).join(", ")}${t.length>3?"…":""}`,type:"error"}):k({visible:!0,message:"PDF created successfully!",type:"success"})}catch(e){console.error("[ImageToPDF] Create failed:",e),k({visible:!0,message:"❌ "+(e.message||"Failed to create the PDF."),type:"error"})}finally{N(!1),S("")}}}(0,a.useEffect)(()=>{let e=(0,h.H)("convert-image-to-pdf");e?.isStartStep?((0,b.$d)(),R(`${e.preset.nextTo}?preset=${e.preset.id}`),I(!1)):R(null)},[]),(0,a.useEffect)(()=>{$.current=e},[e]),(0,a.useEffect)(()=>()=>{$.current.forEach(e=>{try{URL.revokeObjectURL(e.url)}catch(e){}})},[]);let O="px-3 py-1.5 rounded border border-hairline hover:bg-ink/5";return(0,r.jsxs)("div",{className:"pb-24 max-w-4xl mx-auto",children:[(0,r.jsx)(m.A,{visible:w.visible,message:w.message,type:w.type,onClose:()=>k({...w,visible:!1})}),t&&(0,r.jsx)(p.A,{title:"Creating PDF",statusText:C||"Embedding images into PDF..."}),(0,r.jsx)(g.A,{title:"Images to PDF - Convert JPG, PNG to PDF Free",description:"Convert JPG, PNG, WebP, GIF, BMP and HEIC images into one PDF. Drag to set the page order. Runs on your device, so nothing is uploaded.",keywords:"images to PDF, JPG to PDF, PNG to PDF, convert images to PDF, photos to PDF, pictures to PDF",canonical:"https://www.ondevicepdf.com/tools/convert-image-to-pdf"}),(0,r.jsxs)("div",{className:"mb-4 text-center",children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-ink mb-2",children:"\uD83D\uDDBC️ Convert Image to PDF"}),(0,r.jsx)("p",{className:"text-muted-fg",children:"Convert images (JPG, PNG) into a single PDF locally."})]}),(0,r.jsx)(x.A,{currentToolSlug:"convert-image-to-pdf"}),(0,r.jsx)(n.A,{onFiles:U,multiple:!0,accept:"image/*,.heic,.heif",label:"Drop images here or click to select"}),e.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-3",children:[(0,r.jsxs)("span",{className:"text-sm text-muted-fg",children:[e.length," image(s)"]}),(0,r.jsx)("span",{className:"text-xs text-muted-fg",children:"⠯ Drag to set page order (long-press on touch)"})]}),(0,r.jsx)(f.bH,{ids:e.map(e=>e.url),onReorder:(e,t)=>s(s=>(0,f.Pe)(s,e,t)),layout:"list",className:"mt-3 divide-y border rounded bg-card",children:e.map((e,t)=>(0,r.jsxs)(f.Uq,{id:e.url,className:"flex items-center justify-between gap-3 px-3 py-2 bg-card cursor-grab active:cursor-grabbing",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsx)("span",{className:"text-dim select-none","aria-hidden":!0,
1children:"⠿"}),(0,r.jsx)("img",{src:e.url,alt:"",draggable:!1,className:"w-14 h-14 object-cover rounded border select-none"}),(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsx)("p",{className:"truncate font-medium",children:e.name})})]}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("button",{className:O,onPointerDown:e=>e.stopPropagation(),onClick:()=>{s(e=>{let s=[...e],[r]=s.splice(t,1);return r&&URL.revokeObjectURL(r.url),s})},children:"Remove"})})]},e.url))}),(0,r.jsx)("div",{className:"mt-4 border rounded p-3 bg-card",children:(0,r.jsx)(d.A,{value:F,onChange:D})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)("button",{className:"px-4 py-2 rounded bg-brand text-white hover:bg-brand-hover disabled:opacity-50",disabled:0===e.length||t||v,onClick:L,children:v?"Processing…":t?"Building…":"Create PDF"}),E&&(0,r.jsx)("button",{className:O,onClick:()=>{G||(k({visible:!0,message:'ℹ️ Moving to next step. Run "Create PDF" first if you want auto-passed output.',type:"error"}),(0,b.$d)()),window.location.assign(E)},children:"Open Next Step"})]}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)(c.A,{steps:["Drop or select multiple images (JPG, PNG, HEIC).","Reorder or remove any images before exporting.","Click “Create PDF” to download your combined PDF.","Privacy: everything runs in your browser - files never leave your device."]})}),!y.e&&(0,r.jsxs)("div",{className:"max-w-4xl mx-auto mt-12 space-y-8 prose prose-slate",children:[(0,r.jsxs)("section",{children:[(0,r.jsx)("h2",{className:"text-2xl font-semibold text-ink mb-4",children:"About Image to PDF Conversion"}),(0,r.jsx)("p",{className:"text-body leading-relaxed",children:"Our free image to PDF converter combines multiple JPG, PNG, and HEIC images into a single PDF document, all in your browser without uploads. Perfect for consolidating scanned receipts, creating photo albums, or compiling screenshots into professional PDFs. Supports reorder buttons, batch upload, and maintains original image quality without re-compression."}),(0,r.jsx)("p",{className:"text-body leading-relaxed mt-3",children:"Unlike desktop software requiring installation or online services that upload your files, this browser-based tool processes everything locally. Ideal for creating shareable portfolios, organizing scanned documents, or bundling product images for clients."})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)("h2",{className:"text-2xl font-semibold text-ink mb-4",children:"Why Convert Images to PDF?"}),(0,r.jsxs)("ul",{className:"space-y-3 text-body",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{className:"text-ink",children:"\uD83D\uDCC4 Multi-Page Documents:"})," Combine multiple scanned pages (receipts, contracts, invoices) into one searchable file."]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{className:"text-ink",children:"\uD83D\uDD12 Professional Sharing:"})," PDFs preserve layout and prevent accidental edits, perfect for client deliverables."]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{className:"text-ink",children:"\uD83D\uDCE7 Email Efficiency:"})," Send one PDF attachment instead of dozens of separate images."]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{className:"text-ink",children:"\uD83D\uDCF1 Mobile Compatibility:"})," PDFs display consistently across devices; images may scale awkwardly."]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{className:"text-ink",children:"\uD83D\uDDC2️ Archive Organization:"})," Bundle related images (project photos, receipts) into categorized PDFs for easy retrieval."]})]})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)("h3",{className:"text-xl font-semibold text-ink mb-3",children:"Common Use Cases"}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"p-4 bg-green-50 rounded-lg border border-green-200",children:[(0,r.jsx)("h4",{className:"font-semibold text-green-900 mb-2",children:"\uD83E\uDDFE Expense Reports"}),(0,r.jsx)("p",{className:"text-sm text-body",children:"Combine scanned receipts into one PDF for accounting or reimbursement submissions."})]}),(0,r.jsxs)("div",{className:"p-4 bg-brand-faint rounded-lg border border-hairline",children:[(0,r.jsx)("h4",{className:"font-semibold text-ink mb-2",children:"\uD83D\uDCF7 Photo Portfolios"}),(0,r.jsx)("p",{className:"text-sm text-body",children:"Create professional PDF lookbooks for photography, design, or real estate listings."})]}),(0,r.jsxs)("div",{className:"p-4 bg-amber-50 rounded-lg border border-amber-200",children:[(0,r.jsx)("h4",{className:"font-semibold text-amber-900 mb
1-2",children:"\uD83D\uDCD6 Document Scanning"}),(0,r.jsx)("p",{className:"text-sm text-body",children:"Convert phone camera scans of contracts, notes, or forms into shareable PDFs."})]}),(0,r.jsxs)("div",{className:"p-4 bg-brand-faint rounded-lg border border-brand/20",children:[(0,r.jsx)("h4",{className:"font-semibold text-ink mb-2",children:"\uD83D\uDDBC️ Tutorial Guides"}),(0,r.jsx)("p",{className:"text-sm text-body",children:"Bundle step-by-step screenshots into instructional PDFs for training materials."})]})]})]}),(0,r.jsxs)("section",{children:[(0,r.jsx)("h3",{className:"text-xl font-semibold text-ink mb-3",children:"Frequently Asked Questions"}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("details",{className:"p-4 bg-page rounded-lg border border-hairline",children:[(0,r.jsx)("summary",{className:"font-semibold text-ink cursor-pointer",children:"Will images be compressed or lose quality?"}),(0,r.jsx)("p",{className:"mt-2 text-body text-sm",children:"No! Images are embedded at their original resolution without re-compression. Your PDF will preserve full image quality. Expect file sizes similar to the sum of your source images."})]}),(0,r.jsxs)("details",{className:"p-4 bg-page rounded-lg border border-hairline",children:[(0,r.jsx)("summary",{className:"font-semibold text-ink cursor-pointer",children:"Can I reorder images before creating the PDF?"}),(0,r.jsx)("p",{className:"mt-2 text-body text-sm",children:'Yes! Click "Reorder mode" then use the ↑/↓ buttons in the list to reorder images before clicking "Create PDF". Each image becomes one page in the final document in the order displayed.'})]}),(0,r.jsxs)("details",{className:"p-4 bg-page rounded-lg border border-hairline",children:[(0,r.jsx)("summary",{className:"font-semibold text-ink cursor-pointer",children:"What's the maximum number of images?"}),(0,r.jsx)("p",{className:"mt-2 text-body text-sm",children:"No hard limit, but browser performance may degrade with 100+ high-res images. For very large batches, consider splitting into multiple PDFs or using desktop tools."})]})]})]}),(0,r.jsxs)("section",{className:"bg-brand-faint border border-brand/20 rounded-lg p-6",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-ink mb-3",children:"\uD83D\uDD17 Related Tools"}),(0,r.jsx)("p",{className:"text-sm text-body mb-3",children:"Enhance your PDF workflow:"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(o.N,{to:"/tools/convert-pdf-to-image",className:"px-3 py-1.5 bg-card border border-brand/30 rounded text-sm text-accent hover:bg-brand-muted",children:"\uD83D\uDDBC️ PDF to Image"}),(0,r.jsx)(o.N,{to:"/tools/merge-pdf",className:"px-3 py-1.5 bg-card border border-brand/30 rounded text-sm text-accent hover:bg-brand-muted",children:"\uD83E\uDDE9 Merge PDF"}),(0,r.jsx)(o.N,{to:"/tools/compress-pdf",className:"px-3 py-1.5 bg-card border border-brand/30 rounded text-sm text-accent hover:bg-brand-muted",children:"\uD83D\uDDDC️ Compress PDF"})]})]})]})]})}}}]);

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.