PageSourceSearch

https://conversiontab.com/build/assets/image-pdf-page-Cmw7lfy7.js

js conversiontab.com collected 2026-09-24 10:07:40 UTC 2,693 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BGjD53k8.js","assets/_commonjsHelpers-BosuxZz1.js","assets/index-DJ_C-UqT.js"])))=>i.map(i=>d[i]);
2import{_ as D,e as F,T as v}from"./app-gOHIPY12.js";import{saveResultFile as x}from"./ctResultAccessAd-Dk9whJZs.js";import{a as _,c as L}from"./fileDropzone-CA_uaFcV.js";import"./FileSaver.min-BR20wtAe.js";import"./_commonjsHelpers-BosuxZz1.js";import"./ctFullscreenAd-CL-AA_Ul.js";import"./transientNotice-Ds_di7lD.js";function w(f){const t=document.getElementById("ctImgPdfToastBody"),o=document.getElementById("ctImgPdfToast");if(!t||!o||typeof F>"u"){window.alert(f);return}t.textContent=f,v.getOrCreateInstance(o).show()}function A(){if(!document.getElementById("ct-image-pdf-root"))return;const t=document.getElementById("ctImgPdfFiles"),o=document.getElementById("ctImgPdfFilesZone"),E=document.getElementById("ctImgPdfFilesDropCaption"),l=document.getElementById("ctImgPdfBtn"),p=document.getElementById("ctImgPdfClr"),e=document.getElementById("ctImgPdfStatus"),u=document.getElementById("ctImgPdfName");if(!t||!l||!p)return;const y=300,m=()=>{var i;const n=(((i=t.files)==null?void 0:i.length)||0)>0;l.disabled=!n,p.disabled=!n};_({input:t,drop:o,dragContainer:o==null?void 0:o.closest(".card-body"),captionEl:E,onChange:()=>{var n;e&&((n=t.files)!=null&&n.length)&&(e.textContent=`${t.files.length} image(s) selected.`),m()}}),m(),p.addEventListener("click",()=>{L(t),e&&(e.textContent=""),m()}),l.addEventListener("click",async()=>{const n=t.files?Array.from(t.files):[];if(n.length!==0){l.disabled=!0,e&&(e.textContent=`Building PDF from ${n.length} image(s)...`);try{const{PDFDocument:i}=await D(async()=>{const{PDFDocument:s}=await import("./index-BGjD53k8.js");return{PDFDocument:s}},__vite__mapDeps([0,1,2])),d=await i.create();for(const s of n){const h=await s.arrayBuffer(),I=(s.type||"").toLowerCase(),g=document.createElement("img"),P=URL.createObjectURL(s);g.src=P,await g.decode();let c=g.naturalWidth,a=g.naturalHeight;if(a>y){const r=c/a;a=y,c=Math.floor(y*r)}if(URL.revokeObjectURL(P),I.includes("jpeg")||I.includes("jpg")){const r=await d.embedJpg(h);d.addPage([c,a]).drawImage(r,{x:0,y:0,width:c,height:a})}else if(I.includes("png")){const r=await d.embedPng(h);d.addPage([c,a]).drawImage(r,{x:0,y:0,width:c,height:a})}else{w("Only PNG and JPEG are supported in this build.");return}}const B=await d.save(),b=String((u==null?void 0:u.value)||"").trim().replace(/\.pdf$/i,"");x(new Blob([B],{type:"application/pdf"}),`${b||"images"}.pdf`),e&&(e.textContent="Done.")}catch(i){w(i instanceof Error?i.message:"PDF build failed."),e&&(e.textContent="")}finally{m()}}})}export{A as initImagePdfPage};

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.