PageSourceSearch

https://savedelete.com/static/js/2983.ac79c3ff.chunk.js

js savedelete.com collected 2026-10-01 07:28:24 UTC 46,340 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksavedelete_react=self.webpackChunksavedelete_react||[]).push([[2983],{32983:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ne});var s=a(89379),n=a(65043),r=a(49367),i=a(36767),o=a(10290),l=a(82054),c=a(58467),d=a(45732),h=a(79989),x=a(85692),g=a(1367),m=a(28646),p=a(36210),u=a(9463),y=a(38326),f=a(29868),w=a(72313),b=a(7104),j=a(95204),k=a(56804),v=a(15985),N=a(70067),A=a(73728),S=a(56174),C=a(51655),D=a(30086),P=a(84991),F=a(76996),M=a(9855),I=a(84808),R=a(82300),T=a(22642),E=a(8829),W=a(50797),z=a(40614),L=a(21531),_=a(10386),O=a(70579);let U=null,B=null;const Y=async()=>{if(!U){const e=await Promise.all([a.e(5854),a.e(3729),a.e(8224),a.e(3222),a.e(3070),a.e(903)]).then(a.t.bind(a,46749,23));U=e,U.GlobalWorkerOptions.workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js"}if(!B){const e=await Promise.all([a.e(9137),a.e(491),a.e(8965),a.e(3163),a.e(5118),a.e(2193),a.e(1239),a.e(3874),a.e(5924),a.e(5797),a.e(3216),a.e(3891),a.e(9973),a.e(3019),a.e(895),a.e(9930),a.e(736),a.e(9720),a.e(6262),a.e(7823),a.e(9947),a.e(5585),a.e(9478),a.e(5088),a.e(61),a.e(5705),a.e(8766),a.e(6288),a.e(9392)]).then(a.bind(a,46433));B=e.PDFDocument}return{pdfjsLib:U,PDFDocument:B}},Q=e=>e.id.startsWith("whitebox_")||("rectangle"===e.type||"circle"===e.type)&&(e=>{if(!e||"transparent"===e)return!1;const t=document.createElement("canvas").getContext("2d");if(!t)return!1;t.fillStyle="#010203",t.fillStyle=e;const a=String(t.fillStyle);if(a.startsWith("#"))return"#010203"!==a||"#010203"===e.toLowerCase();const s=a.match(/rgba\([^)]*,\s*([\d.]+)\)/);return!!s&&parseFloat(s[1])>=.95})(e.fillColor),V=(e,t,a)=>Math.min(a,Math.sqrt(16e6/(e*t))),X=e=>new Promise((t,a)=>{const s=new Image;s.onload=()=>t(s),s.onerror=()=>a(new Error("Image could not be loaded")),s.src=e}),K=e=>{const{width:t,height:a}=e,s=e.getContext("2d").getImageData(0,0,t,a).data;let n=t,r=a,i=-1,o=-1;for(let l=0;l<a;l++)for(let e=0,a=l*t*4+3;e<t;e++,a+=4)0!==s[a]&&(e<n&&(n=e),e>i&&(i=e),l<r&&(r=l),o=l);return i<0?null:{x:n,y:r,w:i-n+1,h:o-r+1}},G=(e,t,a,s)=>{const[n,r]=((e,t,a)=>e%180===0?[t,a]:[a,t])(e,a,s);switch(((t-e)%360+360)%360){case 90:return[0,1,-1,0,r,0];case 180:return[-1,0,0,-1,n,r];case 270:return[0,-1,1,0,0,n];default:return[1,0,0,1,0,0]}},J={text:16,date:14,pagenumber:12,watermark:48},Z=e=>e.fontSize||J[e.type]||16,q=e=>"text"===e.type||"date"===e.type||"pagenumber"===e.type,H=e=>"date"===e.type?"bold ".concat(Z(e),"px Arial"):"pagenumber"===e.type?"".concat(Z(e),"px Arial"):(e.bold?"bold ":"")+(e.italic?"italic ":"")+Z(e)+"px "+(e.fontFamily||"Arial"),$=e=>"pagenumber"===e.type?"center":"text"===e.type&&e.textAlign||"left";let ee=null;const te=e=>{ee=ee||document.createElement("canvas").getContext("2d");const t=Z(e);let a=0,s=.8*t,n=.2*t;if(ee){ee.font=H(e);const t=ee.measureText(e.content||"");a=t.width,t.fontBoundingBoxAscent&&(s=t.fontBoundingBoxAscent,n=t.fontBoundingBoxDescent)}const r=$(e);return{x:"center"===r?e.x-a/2:"right"===r||"end"===r?e.x-a:e.x,y:e.y-s,width:a,height:s+n}},ae=e=>{if(q(e))return te(e);if(("line"===e.type||"arrow"===e.type)&&void 0!==e.x2&&void 0!==e.y2)return{x:Math.min(e.x,e.x2),y:Math.min(e.y,e.y2),width:Math.abs(e.x2-e.x),height:Math.abs(e.y2-e.y)};if("freehand"===e.type&&e.points&&e.points.length>0){const t=e.points.map(e=>e.x),a=e.points.map(e=>e.y),s=Math.min(...t),n=Math.min(...a);return{x:s,y:n,width:Math.max(...t)-s,height:Math.max(...a)-n}}return{x:e.x,y:e.y,width:e.width,height:e.height}},se=(e,t,a)=>(0,s.A)((0,s.A)((0,s.A)((0,s.A)({},e),{},{x:e.x+t,y:e.y+a},void 0!==e.x2?{x2:e.x2+t}:{}),void 0!==e.y2?{y2:e.y2+a}:{}),e.points?{points:e.points.map(e=>({x:e.x+t,y:e.y+a}))}:{}),ne=()=>{const[e,t]=(0,n.useState)(null),[U,B]=(0,n.useState)(null),[J,ee]=(0,n.use
1State)(null),[ne,re]=(0,n.useState)(1),[ie,oe]=(0,n.useState)(0),[le,ce]=(0,n.useState)(1),[de,he]=(0,n.useState)([]),[xe,ge]=(0,n.useState)(null),[me,pe]=(0,n.useState)(!1),[ue,ye]=(0,n.useState)(!1),[fe,we]=(0,n.useState)(null),[be,je]=(0,n.useState)({x:0,y:0}),[ke,ve]=(0,n.useState)({x:0,y:0,width:0,height:0}),[Ne,Ae]=(0,n.useState)([]),[Se,Ce]=(0,n.useState)(null),[De,Pe]=(0,n.useState)(""),[Fe,Me]=(0,n.useState)(null),[Ie,Re]=(0,n.useState)(!1),[Te,Ee]=(0,n.useState)([]),[We,ze]=(0,n.useState)(""),[Le,_e]=(0,n.useState)(16),[Oe,Ue]=(0,n.useState)("Arial"),[Be,Ye]=(0,n.useState)("#000000"),[Qe,Ve]=(0,n.useState)(!1),[Xe,Ke]=(0,n.useState)(!1),[Ge,Je]=(0,n.useState)(!1),[Ze,qe]=(0,n.useState)("left"),[He,$e]=(0,n.useState)("rgba(255, 255, 0, 0.3)"),[et,tt]=(0,n.useState)("#000000"),[at,st]=(0,n.useState)(2),[nt,rt]=(0,n.useState)([{annotations:[]}]),[it,ot]=(0,n.useState)(0),[lt,ct]=(0,n.useState)(!1),[dt,ht]=(0,n.useState)(null),{isAuthenticated:xt}=(0,i.A)(),[gt,mt]=(0,n.useState)([]),[pt,ut]=(0,n.useState)(!1),[yt,ft]=(0,n.useState)("idle"),[wt,bt]=(0,n.useState)(""),[jt,kt]=(0,n.useState)(!1);(0,n.useEffect)(()=>{xt&&vt()},[xt]);const vt=async()=>{try{const e=await o.A.listEditedPDFs();mt(e)}catch(e){console.error("Error loading edited PDFs:",e)}},Nt=(0,n.useRef)(null),At=(0,n.useRef)(null),St=(0,n.useRef)(null),Ct=(0,n.useRef)(null),Dt=(0,n.useRef)(null),Pt=(0,n.useRef)({rotation:0,width:0,height:0}),Ft=(0,n.useRef)(null),Mt=(e,t)=>{const a=Pt.current;return s=G(a.rotation,t,a.width,a.height),n=e.x,r=e.y,{x:s[0]*n+s[2]*r+s[4],y:s[1]*n+s[3]*r+s[5]};var s,n,r},It=(0,n.useCallback)(e=>{const t=nt.slice(0,it+1);t.push({annotations:[...e]}),rt(t),ot(t.length-1)},[nt,it]),Rt=(0,n.useCallback)(()=>{it>0&&(ot(it-1),he([...nt[it-1].annotations]))},[nt,it]),Tt=(0,n.useCallback)(()=>{it<nt.length-1&&(ot(it+1),he([...nt[it+1].annotations]))},[nt,it]);(0,n.useEffect)(()=>{const e=e=>{e.ctrlKey||e.metaKey?"z"===e.key?(e.preventDefault(),Rt()):"y"===e.key||e.shiftKey&&"z"===e.key?(e.preventDefault(),Tt()):"c"===e.key&&xe&&(e.preventDefault(),Qt()):"Delete"===e.key&&xe&&(e.preventDefault(),Ut(xe))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Rt,Tt,xe]),(0,n.useEffect)(()=>{U&&Nt.current&&Et(ne)},[U,ne,le,de,xe]);const Et=async e=>{if(!U||!Nt.current)return;Dt.current&&Dt.current.cancel();const t=await U.getPage(e),a=t.getViewport({scale:le}),s=t.getViewport({scale:1,rotation:0});Pt.current={rotation:t.rotate,width:s.width,height:s.height};const n=Nt.current,r=n.getContext("2d");n.height=a.height,n.width=a.width;
1const i={canvasContext:r,viewport:a};Dt.current=t.render(i),await Dt.current.promise,Dt.current=null;try{const a=(await t.getTextContent()).items.map((t,a)=>{const n=t.transform,[r,i]=s.convertToViewportPoint(n[4],n[5]),[o,l]=s.convertToViewportPoint(n[4]+t.width,n[5]+t.height);return{id:"text_".concat(e,"_").concat(a),str:t.str,x:Math.min(r,o),y:Math.max(i,l),width:Math.abs(o-r),height:Math.abs(l-i),fontSize:t.height,fontName:t.fontName,pageIndex:e-1,transform:n}});Ae(a)}catch(l){console.error("Error extracting text:",l)}const o=de.filter(t=>t.pageIndex===e-1);r&&(r.save(),r.scale(le,le),o.forEach(e=>{r.save(),r.transform(...G(e.frameRotation,t.rotate,s.width,s.height)),Wt(r,e,e.id===xe),r.restore()}),r.restore())},Wt=(e,t,a,s)=>{var n,r,i,o;switch(e.save(),t.type){case"text":if(e.font=H(t),e.fillStyle=t.color||"#000000",e.textAlign=$(t),e.fillText(t.content,t.x,t.y),t.underline){const a=e.measureText(t.content);e.strokeStyle=t.color||"#000000",e.lineWidth=1,e.beginPath(),e.moveTo(t.x,t.y+2),e.lineTo(t.x+a.width,t.y+2),e.stroke()}break;case"image":case"signature":let a=null===s||void 0===s?void 0:s.get(t.content);a||(a=new Image,a.src=t.content);try{e.drawImage(a,t.x,t.y,t.width,t.height)}catch(l){}break;case"highlight":e.fillStyle=t.fillColor||"rgba(255, 255, 0, 0.3)",e.fillRect(t.x,t.y,t.width,t.height);break;case"rectangle":t.fillColor&&"transparent"!==t.fillColor&&(e.fillStyle=t.fillColor,e.fillRect(t.x,t.y,t.width,t.height)),t.strokeColor&&(e.strokeStyle=t.strokeColor,e.lineWidth=t.strokeWidth||2,e.strokeRect(t.x,t.y,t.width,t.height));break;case"circle":const c=t.x+t.width/2,d=t.y+t.height/2,h=Math.min(t.width,t.height)/2;e.beginPath(),e.arc(c,d,h,0,2*Math.PI),t.fillColor&&"transparent"!==t.fillColor&&(e.fillStyle=t.fillColor,e.fill()),t.strokeColor&&(e.strokeStyle=t.strokeColor,e.lineWidth=t.strokeWidth||2,e.stroke());break;case"line":e.strokeStyle=t.strokeColor||"#000000",e.lineWidth=t.strokeWidth||2,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(null!==(n=t.x2)&&void 0!==n?n:t.x+t.width,null!==(r=t.y2)&&void 0!==r?r:t.y+t.height),e.stroke();break;case"arrow":e.strokeStyle=t.strokeColor||"#000000",e.fillStyle=t.strokeColor||"#000000",e.lineWidth=t.strokeWidth||2;const x=null!==(i=t.x2)&&void 0!==i?i:t.x+t.width,g=null!==(o=t.y2)&&void 0!==o?o:t.y+t.height;e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(x,g),e.stroke();const m=Math.atan2(g-t.y,x-t.x),p=15;e.beginPath(),e.moveTo(x,g),e.lineTo(x-p*Math.cos(m-Math.PI/6),g-p*M
1ath.sin(m-Math.PI/6)),e.lineTo(x-p*Math.cos(m+Math.PI/6),g-p*Math.sin(m+Math.PI/6)),e.closePath(),e.fill();break;case"freehand":if(t.points&&t.points.length>1){e.strokeStyle=t.strokeColor||"#000000",e.lineWidth=t.strokeWidth||2,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(t.points[0].x,t.points[0].y);for(let a=1;a<t.points.length;a++)e.lineTo(t.points[a].x,t.points[a].y);e.stroke()}break;case"checkmark":e.strokeStyle="#22c55e",e.fillStyle="#22c55e",e.lineWidth=4;const u=Math.min(t.width,t.height);e.beginPath(),e.moveTo(t.x+.2*u,t.y+.5*u),e.lineTo(t.x+.4*u,t.y+.7*u),e.lineTo(t.x+.8*u,t.y+.3*u),e.stroke();break;case"xmark":e.strokeStyle="#ef4444",e.lineWidth=4;const y=Math.min(t.width,t.height);e.beginPath(),e.moveTo(t.x+.2*y,t.y+.2*y),e.lineTo(t.x+.8*y,t.y+.8*y),e.moveTo(t.x+.8*y,t.y+.2*y),e.lineTo(t.x+.2*y,t.y+.8*y),e.stroke();break;case"date":e.font=H(t),e.fillStyle=t.color||"#000000",e.fillText(t.content,t.x,t.y);break;case"stickynote":if(e.fillStyle="#fef08a",e.fillRect(t.x,t.y,t.width,t.height),e.strokeStyle="#eab308",e.lineWidth=2,e.strokeRect(t.x,t.y,t.width,t.height),t.content){e.fillStyle="#000000",e.font=(t.fontSize||12)+"px Arial";t.content.split("\\n").forEach((a,s)=>{e.fillText(a,t.x+10,t.y+20+16*s)})}break;case"textbox":e.fillStyle="#ffffff",e.fillRect(t.x,t.y,t.width,t.height),e.strokeStyle=t.strokeColor||"#000000",e.lineWidth=t.strokeWidth||1,e.strokeRect(t.x,t.y,t.width,t.height),t.content&&(e.fillStyle=t.color||"#000000",e.font=(t.fontSize||12)+"px "+(t.fontFamily||"Arial"),e.fillText(t.content,t.x+10,t.y+t.height/2));break;case"watermark":e.save(),e.translate(t.x+t.width/2,t.y+t.height/2),e.rotate(-45*Math.PI/180),e.font="bold "+Z(t)+"px Arial",e.fillStyle="rgba(200, 200, 200, 0.3)",e.textAlign="center",e.fillText(t.content||"WATERMARK",0,0),e.restore();break;case"pagenumber":e.font=H(t),e.fillStyle=t.color||"#000000",e.textAlign=$(t),e.fillText(t.content,t.x,t.y)}if(a){const a=1/le,s=ae(t);e.strokeStyle="#22c55e",e.lineWidth=2*a,e.setLineDash([5*a,5*a]),e.strokeRect(s.x-5*a,s.y-5*a,s.width+10*a,s.height+10*a);const n=10*a;e.fillStyle="#22c55e",e.setLineDash([]),e.fillRect(s.x-n/2,s.y-n/2,n,n),e.fillRect(s.x+s.width-n/2,s.y-n/2,n,n),e.fillRect(s.x-n/2,s.y+s.height-n/2,n,n),e.fillRect(s.x+s.width-n/2,s.y+s.height-n/2,n,n)}e.restore()},zt=e=>{if(!Nt.current)return{x:0,y:0};const t=Nt.current,a=t.getBoundingClientRect();return{x:(e.clientX-a.left)*(t.width/a.width)/le,y:(e.clientY-a.top)*(t.height/a.height)/le}},Lt=(e,t,a)=>{const{x:s,y:n}=Mt({x:e,y:t},a.frameRotation),r=10/le,i=ae(a),o={"top-left":{x:i.x-r/2,y:i.y-r/2},"top-right":{x:i.x+i.width-r/2,y:i.y-r/2},"bottom-left":{x:i.x-r/2,y:i.y+i.height-r/2},"bottom-right":{x:i.x+i.width-r/2,y:i.y+i.height-r/2}};for(const[l,c]of Object.entries(o))if(s>=c.x&&s<=c.x+r&&n>=c.y&&n<=c.y+r)return l;return null},_t=(e,t,a)=>{const n=Ot(e,t,a);return n&&(0,s.A)((0,s.A)({},n),{},{frameRotation:Pt.current.rotation})},Ot=(e,t,a)=>{const s="ann_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);switch(e){case"text":return We?{id:s,type:"text",x:t.x,y:t.y,width:200,height:Le+10,content:We,pageIndex:ne-1,fontSize:Le,fontFamily:Oe,color:Be,bold:Qe,italic:Xe,underline:Ge,textAlign:Ze}:null;case"highlight":case"rectangle":case"circle":const n=Math.abs(a.x-t.x),r=Math.abs(a.y-t.y);return{id:s,type:e,x:Math.min(t.x,a.x),y:Math.min(t.y,a.y),width:n||100,height:r||("circle"===e?n:50),content:"",pageIndex:ne-1,fillColor:"highlight"===e?"rgba(255, 255, 0, 0.3)":He,strokeColor:et,strokeWidth:at};case"line":case"arrow":return{id:s,type:e,x:t.x,y:t.y,x2:a.x,y2:a.y,width:Math.abs(a.x-t.x),height:Math.abs(a.y-t.y),content:"",pageIndex:ne-1,strokeColor:et,strokeWidth:at};case"freehand":if(Te.length<2)return null;const i=Math.min(...Te.map(e=>e.x)),o=Math.min(...Te.map(e=>e.y));return{id:s,type:"freehand",x:i,y:o,width:Math.max(...Te.map(e=>e.x))-i,height:Math.max(...Te.map(e=>e.y))-o,content:"",pageIndex:ne-1,points:Te,strokeColor:et,strokeWidth:at};case"checkmark":return{id:s,type:"checkmark",x:t.x,y:t.y,width:40,height:40,content:"",pageIndex:ne-1};case"xmark":return{id:s,type:"xmark",x:t.x,y:t.y,width:40,height:40,content:"",pageIndex:ne-1};case"date":const l=(new Date).toLocaleDateString();return{id:s,type:"date",x:t.x,y:t.y,width:100,height:20,content:l,pageIndex:ne-1,fontSize:14,color:"#000000"};case"stickynote":return{id:s,type:"stickynote",x:t.x,y:t.y,width:150,height:100,content:"Note...",pageIndex:ne-1,fontSize:12};case"textbox":return We?{id:s,type:"textbox",x:t.x,y:t.y,width:200,height:40,content:We,pageIndex:ne-1,fontSize:Le,fontFamily:Oe,color:Be,strokeColor:"#000000",strokeWidth:1}:null;case"watermark":return{id:s,type:"watermark",x:100,y:300,width:400,height:100,content:We||"WATERMARK",pageIndex:ne-1,fontSize:48,color:"#cccccc"};case"pagenumber":return{id:s,type:"pagenumber",x:t.x,y:t.y,width:50,height:20,content:"Page "+ne,pageIndex:ne-1,fontSize:12,color:"#000000"};default:return null}},Ut=e=>{const t=de.filter(t=>t.id!==e);he(t),It(t),ge(null)},Bt=()=>{if(!Se)return;
1const e=Ne.find(e=>e.id===Se);if(!e)return;const t={id:"whitebox_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),type:"rectangle",x:e.x-2,y:e.y-e.height-2,width:e.width+4,height:e.height+4,content:"",pageIndex:e.pageIndex,fillColor:"#FFFFFF",strokeColor:"#FFFFFF",strokeWidth:0,frameRotation:0},a={id:"text_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),type:"text",x:e.x,y:e.y,width:e.width,height:e.height,content:De,pageIndex:e.pageIndex,fontSize:e.fontSize,fontFamily:"Arial",color:"#000000",frameRotation:0},s=[...de,t,a];he(s),It(s),Ce(null),Pe("")},Yt=()=>{Ce(null),Pe("")},Qt=()=>{if(!xe)return;const e=de.find(e=>e.id===xe);if(!e)return;const t=se((0,s.A)((0,s.A)({},e),{},{id:"ann_"+Date.now()+"_"+Math.random().toString(36).substr(2,9)}),20,20),a=[...de,t];he(a),It(a),ge(t.id)};return(0,O.jsxs)("div",{className:"min-h-screen bg-gray-50 py-8",children:[(0,O.jsxs)(r.mg,{children:[(0,O.jsx)("title",{children:"Free PDF Editor Online - Add Text, Images, Checkmarks, Stamps & More | SaveDelete"}),(0,O.jsx)("meta",{name:"description",content:"Professional PDF editor with 15+ tools: add text, images, checkmarks, X marks, date stamps, sticky notes, watermarks, shapes, signatures & more. Drag & drop annotations. 100% free, no registration."}),(0,O.jsx)("meta",{name:"keywords",content:"pdf editor, free pdf editor, online pdf editor, edit pdf online, add text to pdf, pdf annotation tool, pdf signature, pdf watermark, pdf highlighter, pdf form filler, edit pdf free, pdf markup, pdf drawing tools, annotate pdf, pdf viewer editor"}),(0,O.jsx)("meta",{name:"author",content:"SaveDelete"}),(0,O.jsx)("meta",{name:"robots",content:"index, follow"}),(0,O.jsx)("link",{rel:"canonical",href:"https://savedelete.com/free-online-pdf-editor/"}),(0,O.jsx)("meta",{property:"og:type",content:"website"}),(0,O.jsx)("meta",{property:"og:url",content:"https://savedelete.com/free-online-pdf-editor/"}),(0,O.jsx)("meta",{property:"og:title",content:"Free PDF Editor Online - Add Text, Images, Checkmarks, Stamps & More | SaveDelete"}),(0,O.jsx)("meta",{property:"og:description",content:"Professional PDF editor with 15+ tools. Add text, images, signatures, watermarks, shapes, and annotations. Drag & drop editing. 100% free, no registration required."}),(0,O.jsx)("meta",{property:"og:image",content:"https://savedelete.com/images/og-image-pdf.jpg"}),(0,O.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,O.jsx)("meta",{property:"og:image:height",content:"630"}),(0,O.jsx)("meta",{property:"og:site_name",content:"SaveDelete"}),(0,O.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,O.jsx)("meta",{name:"twitter:url",content:"https://savedelete.com/free-online-pdf-editor/"}),(0,O.jsx)("meta",{name:"twitter:title",content:"Free PDF Editor Online - Add Text, Images, Checkmarks & More"}),(0,O.jsx)("meta",{name:"twitter:description",content:"Professional PDF editor with 15+ tools. Add text, images, signatures, watermarks, shapes, and annotations. 100% free, no registration."}),(0,O.jsx)("meta",{name:"twitter:image",content:"https://savedelete.com/images/og-image-pdf.jpg"}),(0,O.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"SoftwareApplication",name:"SaveDelete PDF Editor",url:"https://savedelete.com/free-online-pdf-editor/",description:"Professional PDF editor with 15+ tools: add text, images, checkmarks, X marks, date stamps, sticky notes, watermarks, shapes, signatures & more.",applicationCategory:"BusinessApplication",operatingSystem:"All",isAccessibleForFree:!0,datePublished:"2024-03-01",dateModified:"2025-12-15",screenshot:{"@type":"ImageObject",url:"https://savedelete.com/images/og-pdf-editor.jpg",width:1200,height:630,caption:"Free PDF Editor Online - Edit PDFs with 15+ Tools"},offers:{"@type":"Offer",price:"0",priceCurrency:"USD",availability:"https://schema.org/InStock"},featureList:["Add and edit text with custom fonts and colors","Insert images and logos","Checkmarks and X marks","Date stamps and sticky notes","Custom watermarks and page numbers","Drawing tools (shapes, lines, arrows, freehand)","Highlighter tool","Digital signatures","Text boxes with formatting","Drag & drop annotations","Undo/Redo functionality","Page rotation and deletion","Zoom and navigation controls","Export edited PDF","No registration required"],author:{"@type":"Organization",name:"SaveDelete"}})}),(0,O.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://savedelete.com/"},{"@type":"ListItem",position:2,name:"Free Tools",item:"https://savedelete.com/tools/"},{"@type":"ListItem",position:3,name:"PDF Editor",item:"https://savedelete.com/free-online-pdf-editor/"}]})}),(0,O.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:[{"@type":"Question",name:"Is this PDF editor really free?",acceptedA
1nswer:{"@type":"Answer",text:"Yes, our PDF editor is 100% free with no hidden fees or subscriptions. You get access to all 15+ editing tools including text, images, signatures, watermarks, shapes, and annotations without any cost. No registration or account creation required."}},{"@type":"Question",name:"What tools are available in the PDF editor?",acceptedAnswer:{"@type":"Answer",text:"Our PDF editor includes 15+ professional tools: add text with custom fonts and formatting, insert images, add checkmarks and X marks, date stamps, sticky notes, watermarks, page numbers, shapes (rectangles, circles, lines, arrows), highlighter, freehand drawing, digital signatures, text boxes, and more. All tools support drag & drop positioning."}},{"@type":"Question",name:"Can I sign documents with this PDF editor?",acceptedAnswer:{"@type":"Answer",text:"Yes, you can add digital signatures to your PDF documents. You can draw your signature using the freehand tool or upload an image of your signature. The signature can be positioned anywhere on the document and resized as needed."}},{"@type":"Question",name:"How do I add a watermark to my PDF?",acceptedAnswer:{"@type":"Answer",text:"Select the watermark tool from the toolbar, enter your watermark text, and customize the color, size, and transparency. Click anywhere on the PDF to place the watermark. You can drag it to reposition and resize it using the corner handles. The watermark will appear on the current page."}},{"@type":"Question",name:"Are my PDF files saved on your servers?",acceptedAnswer:{"@type":"Answer",text:"No, all PDF editing happens directly in your browser. Your files are never uploaded to our servers. When you upload a PDF, it stays on your device and is processed locally. When you download the edited PDF, it's generated in your browser. This ensures complete privacy and security."}},{"@type":"Question",name:"Can I undo changes if I make a mistake?",acceptedAnswer:{"@type":"Answer",text:"Yes, the PDF editor includes full undo/redo functionality. Use the undo button or press Ctrl+Z (Cmd+Z on Mac) to undo your last change. Press Ctrl+Y (Cmd+Y on Mac) to redo. The editor maintains a complete history of your changes during the editing session."}},{"@type":"Question",name:"What file format is the output?",acceptedAnswer:{"@type":"Answer",text:"The edited document is exported as a standard PDF file that can be opened in any PDF reader. All annotations, text, images, and modifications are permanently embedded in the PDF, maintaining full compatibility with Adobe Acrobat and other PDF software."}}]})})]}),(0,O.jsxs)("div",{className:"container mx-auto px-4",children:[(0,O.jsxs)("div",{className:"text-center mb-8",children:[(0,O.jsxs)("h1",{className:"text-4xl font-bold text-gray-900 mb-4 flex items-center justify-center gap-2",children:[(0,O.jsx)(d.A,{className:"w-10 h-10 text-primary-600"}),"Professional PDF Editor"]}),(0,O.jsx)("p",{className:"text-xl text-gray-600 mb-4",children:"Add Text, Checkmarks, Stamps, Sticky Notes & More \u2022 Drag & Drop \u2022 100% Free"}),(0,O.jsxs)("div",{className:"flex flex-wrap justify-center gap-3 text-sm",children:[(0,O.jsxs)("div",{className:"flex items-center gap-2 text-gray-700",children:[(0,O.jsx)(l.A,{className:"w-5 h-5 text-green-600"}),(0,O.jsx)("span",{children:"15+ Annotation Tools"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-2 text-gray-700",children:[(0,O.jsx)(l.A,{className:"w-5 h-5 text-green-600"}),(0,O.jsx)("span",{children:"Checkmarks & Stamps"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-2 text-gray-700",children:[(0,O.jsx)(l.A,{className:"w-5 h-5 text-green-600"}),(0,O.jsx)("span",{children:"Sticky Notes & Comments"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-2 text-gray-700",children:[(0,O.jsx)(l.A,{className:"w-5 h-5 text-green-600"}),(0,O.jsx)("span",{children:"Watermarks & Dates"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-2 text-gray-700",children:[(0,O.jsx)(l.A,{className:"w-5 h-5 text-green-600"}),(0,O.jsx)("span",{children:"Drag & Move Anything"})]}),(0,O.jsxs)("div",{className:"flex items-center gap-2 text-gray-700",children:[(0,O.jsx)(l.A,{className:"w-5 h-5 text-green-600"}),(0,O.jsx)("span",{children:"Shapes & Signatures"})]})]})]}),e?(0,O.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[(0,O.jsx)("div",{className:"lg:col-span-1",children:(0,O.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-4 sticky top-8 max-h-screen overflow-y-auto",children:[(0,O.jsx)("h3",{className:"font-semibold text-gray-900 mb-4",children:"Tools"}),(0,O.jsxs)("div",{className:"mb-4",children:[(0,O.jsxs)("button",{onClick:()=>Me("text"===Fe?null:"text"),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors "+("text"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),children:[(0,O.jsx)(R.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Add Text"})]}),"text"===Fe&&(0,O.jsxs)("div",{className:"mt-2 space-y-2 p-2 bg-gray-50 rounded",children:[(0,O.jsx)("input",{type:"text",value:We,onChange:e=>ze(e.target.value),placeholder:"Enter text...",className:"w-full px-2 py-1 border border-gray-300 rounded text-xs"}),(0,O.jsxs)("select",{value:Oe,onChange:e=>Ue(e.target.value),className:"w-full px-2 py-1 border border-gray-300 rounded text-xs",children:[(0,O.jsx)("option",{value:"Arial",children:"Arial"}),(0,O.jsx)("option",{value:"Times New Roman",children:"Times New Roman"}),(0,O.jsx)("option",{value:"Courier New",children:"Courier New"}),(0,O.jsx)("option",{value:"Georgia",children:"Georgia"}),(0,O.jsx)("option",{value:"Verdana",children:"Verdana"})]}),(0,O.jsxs)("div",{className:"flex gap-1",children:[(0,O.jsx)("input",{type:"number",value:Le,onChange:e=>_e(Number(e.target.value)),className:"w-full px-2 py-1 border border-gray-300 rounded text-xs",min:"8",max:"72"}),(0,O.jsx)("input",{type:"color",value:Be,onChange:e=>Ye(e.target.value),className:"w-12 h-8 rounded"})]}),(0,O.jsxs)("div",{className:"flex gap-1",children:[(0,O.jsx)("button",{onClick:()=>Ve(!Qe),className:"flex-1 p-1 rounded "+(Qe?"bg-primary-600 text-white":"bg-gray-200"),children:(0,O.jsx)(g.A,{className:"w-4 h-4 mx-auto"})}),(0,O.jsx)("button",{onClick:()=>Ke(!Xe),className:"flex-1 p-1 rounded "+(Xe?"bg-primary-600 text-white":"bg-gray-200"),children:(0,O.jsx)(A.A,{className:"w-4 h-4 mx-auto"})}),(0,O.jsx)("button",{onClick:()=>Je(!Ge),className:"flex-1 p-1 rounded "+(Ge?"bg-primary-600 text-white":"bg-gray-200"),children:(0,O.jsx)(T.A,{className:"w-4 h-4 mx-auto"})})]})]})]}),(0,O.jsxs)("button",{onClick:()=>{var e;return null===(e=St.current)||void 0===e?void 0:e.click()},className:"w-full flex items-center gap-2 px-3 py-2 mb-2 rounded-lg text-sm bg-gray-100 hover:bg-gray-200",children:[(0,O.jsx)(N.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Add Image"})]}),(0,O.jsx)("input",{ref:St,type:"file",accept:"image/*",onChange:async e=>{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;const s=new FileReader;s.onload=e=>{var t;const a=null===(t=e.target)||void 0===t?void 0:t.result;if(a){const e=new Image;e.onload=()=>{const t={id:"ann_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),type:"image",x:50,y:50,width:Math.min(e.width,200),height:Math.min(e.height,200),content:a,pageIndex:ne-1,frameRotation:Pt.current.rotation},s=[...de,t];he(s),It(s)},e.src=a}},s.readAsDataURL(a)},className:"hidden"}),(0,O.jsxs)("div",{className:"mb-4",children:[(0,O.jsx)("p",{className:"text-xs font-semibold text-gray-600 mb-2",children:"Shapes"}),(0,O.jsx)("div",{className:"grid grid-cols-2 gap-1",children:["rectangle","circle","line","arrow"].map(e=>(0,O.jsxs)("button",{onClick:()=>Me(e),className:"flex items-center justify-center gap-1 px-2 py-2 rounded text-xs "+(Fe===e?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),children:["rectangle"===e&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(P.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Box"})]}),"circle"===e&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(f.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Circle"})]}),"line"===e&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(S.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Line"})]}),"arrow"===e&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(x.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Arrow"})]})]},e))})]}),(0,O.jsxs)("button",{onClick:()=>Me("freehand"),className:"w-full flex items-center gap-2 px-3 py-2 mb-2 rounded-lg text-sm "+("freehand"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),children:[(0,O.jsx)(h.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Freehand Draw"})]}),(0,O.jsxs)("button",{onClick:()=>Me("highlight"),className:"w-full flex items-center gap-2 px-3 py-2 mb-2 rounded-lg text-sm "+("highlight"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),children:[(0,O.jsx)(v.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Highlight"})]}),(0,O.jsxs)("div",{className:"mb-4",children:[(0,O.jsx)("p",{className:"text-xs font-semibold text-gray-600 mb-2",children:"Qu
1ick Tools"}),(0,O.jsxs)("div",{className:"grid grid-cols-3 gap-1",children:[(0,O.jsx)("button",{onClick:()=>Me("checkmark"),className:"flex items-center justify-center px-2 py-2 rounded text-xs "+("checkmark"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),title:"Checkmark",children:(0,O.jsx)(p.A,{className:"w-4 h-4"})}),(0,O.jsx)("button",{onClick:()=>Me("xmark"),className:"flex items-center justify-center px-2 py-2 rounded text-xs "+("xmark"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),title:"X Mark",children:(0,O.jsx)(z.A,{className:"w-4 h-4"})}),(0,O.jsx)("button",{onClick:()=>Me("date"),className:"flex items-center justify-center px-2 py-2 rounded text-xs "+("date"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),title:"Date Stamp",children:(0,O.jsx)(m.A,{className:"w-4 h-4"})}),(0,O.jsx)("button",{onClick:()=>Me("stickynote"),className:"flex items-center justify-center px-2 py-2 rounded text-xs "+("stickynote"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),title:"Sticky Note",children:(0,O.jsx)(F.A,{className:"w-4 h-4"})}),(0,O.jsx)("button",{onClick:()=>Me("watermark"),className:"flex items-center justify-center px-2 py-2 rounded text-xs "+("watermark"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),title:"Watermark",children:(0,O.jsx)(j.A,{className:"w-4 h-4"})}),(0,O.jsx)("button",{onClick:()=>Me("pagenumber"),className:"flex items-center justify-center px-2 py-2 rounded text-xs "+("pagenumber"===Fe?"bg-primary-600 text-white":"bg-gray-100 hover:bg-gray-200"),title:"Page Number",children:(0,O.jsx)(k.A,{className:"w-4 h-4"})})]})]}),(0,O.jsxs)("button",{onClick:()=>{var e;return null===(e=Ct.current)||void 0===e?void 0:e.click()},className:"w-full flex items-center gap-2 px-3 py-2 mb-4 rounded-lg text-sm bg-gray-100 hover:bg-gray-200",children:[(0,O.jsx)(c.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Add Signature"})]}),(0,O.jsx)("input",{ref:Ct,type:"file",accept:"image/*",onChange:async e=>{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;const s=new FileReader;s.onload=e=>{var t;const a=null===(t=e.target)||void 0===t?void 0:t.result;if(a){const e=new Image;e.onload=()=>{const e={id:"ann_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),type:"signature",x:100,y:100,width:150,height:50,content:a,pageIndex:ne-1,frameRotation:Pt.current.rotation},t=[...de,e];he(t),It(t)},e.src=a}},s.readAsDataURL(a)},className:"hidden"}),(0,O.jsxs)("div",{className:"border-t pt-3 mt-3",children:[(0,O.jsx)("p",{className:"text-xs font-semibold text-gray-600 mb-2",children:"Actions"}),(0,O.jsxs)("div",{className:"flex gap-1 mb-2",children:[(0,O.jsx)("button",{onClick:Rt,disabled:0===it,className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded text-xs bg-gray-100 hover:bg-gray-200 disabled:opacity-50",title:"Undo (Ctrl+Z)",children:(0,O.jsx)(E.A,{className:"w-3 h-3"})}),(0,O.jsx)("button",{onClick:Tt,disabled:it===nt.length-1,className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded text-xs bg-gray-100 hover:bg-gray-200 disabled:opacity-50",title:"Redo (Ctrl+Y)",children:(0,O.jsx)(C.A,{className:"w-3 h-3"})})]}),xe&&(0,O.jsxs)("div",{className:"flex gap-1 mb-2",children:[(0,O.jsxs)("button",{onClick:Qt,className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded text-xs bg-gray-100 hover:bg-gray-200",title:"Copy (Ctrl+C)",children:[(0,O.jsx)(w.A,{className:"w-3 h-3"}),(0,O.jsx)("span",{children:"Copy"})]}),(0,O.jsxs)("button",{onClick:()=>Ut(xe),className:"flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded text-xs bg-red-100 hover:bg-red-200 text-red-700",title:"Delete (Del)",children:[(0,O.jsx)(I.A,{className:"w-3 h-3"}),(0,O.jsx)("span",{children:"Delete"})]})]}),(0,O.jsxs)("button",{onClick:async()=>{if(J)try{const{pdfjsLib:e,PDFDocument:t}=await Y(),a=J.getPage(ne-1),s=a.getRotation().angle;a.setRotation({type:"degrees",angle:s+90});const n=await J.save(),r=await t.load(n);ee(r);const i=e.getDocument({data:n}),o=await i.promise;B(o)}catch(e){console.error("Error rotating page:",e)}},className:"w-full flex items-center gap-2 px-3 py-2 mb-1 rounded-lg text-xs bg-gray-100 hover:bg-gray-200",children:[(0,O.jsx)(D.A,{className:"w-3 h-3"}),(0,O.jsx)("span",{children:"Rotate Page"})]}),(0,O.jsxs)("button",{onClick:async()=>
1{if(!J||ie<=1)alert("Cannot delete the only page");else if(window.confirm("Delete page "+ne+"?"))try{const{pdfjsLib:e}=await Y(),t=ne-1;J.removePage(t);const a=de.filter(e=>e.pageIndex!==t).map(e=>e.pageIndex>t?(0,s.A)((0,s.A)({},e),{},{pageIndex:e.pageIndex-1}):e);he(a),rt([{annotations:a}]),ot(0),ge(null),oe(ie-1),ne>1&&re(ne-1);const n=await J.save(),r=e.getDocument({data:n}),i=await r.promise;B(i)}catch(e){console.error("Error deleting page:",e)}},className:"w-full flex items-center gap-2 px-3 py-2 mb-3 rounded-lg text-xs bg-red-50 text-red-700 hover:bg-red-100",children:[(0,O.jsx)(M.A,{className:"w-3 h-3"}),(0,O.jsx)("span",{children:"Delete Page"})]}),(0,O.jsxs)("button",{onClick:async()=>{if(J&&U)try{const t=await Promise.all([a.e(9137),a.e(491),a.e(8965),a.e(3163),a.e(5118),a.e(2193),a.e(1239),a.e(3874),a.e(5924),a.e(5797),a.e(3216),a.e(3891),a.e(9973),a.e(3019),a.e(895),a.e(9930),a.e(736),a.e(9720),a.e(6262),a.e(7823),a.e(9947),a.e(5585),a.e(9478),a.e(5088),a.e(61),a.e(5705),a.e(8766),a.e(6288),a.e(9392)]).then(a.bind(a,46433)),s=await t.PDFDocument.load(await J.save()),n=new Map;for(const e of de)"image"!==e.type&&"signature"!==e.type||n.has(e.content)||n.set(e.content,await X(e.content));for(let e=0;e<s.getPageCount();e++){const a=de.filter(t=>t.pageIndex===e);if(0===a.length)continue;const r=await U.getPage(e+1),i=r.getViewport({scale:1}),o=a.some(Q),l=V(i.width,i.height,o?2:3),c=document.createElement("canvas");c.width=Math.round(i.width*l),c.height=Math.round(i.height*l);const d=c.getContext("2d");if(!d)throw new Error("No 2D canvas context");o&&await r.render({canvasContext:d,viewport:r.getViewport({scale:l}),intent:"print"}).promise,d.scale(l,l);const h=r.getViewport({scale:1,rotation:0});if(a.forEach(e=>{d.save(),d.transform(...G(e.frameRotation,r.rotate,h.width,h.height)),Wt(d,e,!1,n),d.restore()}),o){const t=await s.embedJpg(c.toDataURL("image/jpeg",.92));s.removePage(e),s.insertPage(e,[i.width,i.height]).drawImage(t,{x:0,y:0,width:i.width,height:i.height})}else{const a=K(c);if(!a)continue;const n=document.createElement("canvas");n.width=a.w,n.height=a.h,n.getContext("2d").drawImage(c,a.x,a.y,a.w,a.h,0,0,a.w,a.h);const r=await s.embedPng(n.toDataURL("image/png")),o=(e,t)=>i.convertToPdfPoint(e/l,t/l),[d,h]=o(a.x,a.y+a.h),[x,g]=o(a.x+a.w,a.y+a.h),[m,p]=o(a.x,a.y),u=s.getPage(e),y=u.node.newXObject("Image",r.ref);u.pushOperators(t.pushGraphicsState(),t.concatTransformationMatrix(x-d,g-h,m-d,p-h,d,h),t.drawObject(y),t.popGraphicsState())}}await s.flush(),((e,t)=>{const{context:a}=e,s=new Set,n=Object.values(a.trailerInfo);for(;n.length;){const e=n.pop();if(e instanceof t.PDFRef){if(s.has(e.tag))continue;s.add(e.tag),n.push(a.lookup(e))}
1else e instanceof t.PDFDict?e.values().forEach(e=>n.push(e)):e instanceof t.PDFArray?e.asArray().forEach(e=>n.push(e)):e instanceof t.PDFStream&&n.push(e.dict)}for(const[r]of a.enumerateIndirectObjects())s.has(r.tag)||a.delete(r)})(s,t);const r=new Uint8Array(await s.save()),i=URL.createObjectURL(new Blob([r],{type:"application/pdf"})),o=document.createElement("a");o.href=i,o.download=e?e.name.replace(/\.pdf$/i,"")+"_edited.pdf":"edited.pdf",o.click(),setTimeout(()=>URL.revokeObjectURL(i),3e4)}catch(t){console.error("Error downloading PDF:",t),alert("Error saving PDF. Please try again.")}},className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm bg-green-600 text-white hover:bg-green-700",children:[(0,O.jsx)(b.A,{className:"w-4 h-4"}),(0,O.jsx)("span",{children:"Download PDF"})]})]}),(0,O.jsx)("div",{className:"border-t pt-3 mt-3",children:(0,O.jsxs)("div",{className:"text-xs text-gray-600 space-y-1",children:[(0,O.jsxs)("div",{className:"truncate",children:["File: ",e.name]}),(0,O.jsxs)("div",{children:["Size: ",(e.size/1024/1024).toFixed(2)," MB"]}),(0,O.jsxs)("div",{children:["Annotations: ",de.filter(e=>e.pageIndex===ne-1).length]})]})})]})}),(0,O.jsx)("div",{className:"lg:col-span-3",children:(0,O.jsxs)("div",{className:"bg-white rounded-lg shadow-sm p-6",children:[(0,O.jsxs)("div",{className:"flex items-center justify-between mb-4 pb-4 border-b",children:[(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[(0,O.jsx)("button",{onClick:()=>re(Math.max(1,ne-1)),disabled:1===ne,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-50",children:(0,O.jsx)(u.A,{className:"w-5 h-5"})}),(0,O.jsxs)("span",{className:"text-sm font-medium",children:["Page ",ne," of ",ie]}),(0,O.jsx)("button",{onClick:()=>re(Math.min(ie,ne+1)),disabled:ne===ie,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-50",children:(0,O.jsx)(y.A,{className:"w-5 h-5"})})]}),(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[(0,O.jsx)("button",{onClick:()=>ce(Math.max(.5,le-.1)),className:"p-2 rounded hover:bg-gray-100",children:(0,O.jsx)(_.A,{className:"w-5 h-5"})}),(0,O.jsxs)("span",{className:"text-sm font-medium",children:[Math.round(100*le),"%"]}),(0,O.jsx)("button",{onClick:()=>ce(Math.min(2,le+.1)),className:"p-2 rounded hover:bg-gray-100",children:(0,O.jsx)(L.A,{className:"w-5 h-5"})})]})]}),(0,O.jsxs)("div",{className:"overflow-auto max-h-[600px] border border-gray-200 rounded relative",children:[(0,O.jsx)("canvas",{ref:Nt,onMouseDown:e=>{const t=zt(e);if(!Fe){const e=de.find(e=>e.id===xe&&e.pageIndex===ne-1),a=e?Lt(t.x,t.y,e):null,s=e&&a?e:((e,t)=>{const a=de.filter(e=>e.pageIndex===ne-1);for(let s=a.length-1;s>=0;s--){const n=a[s],r=Mt({x:e,y:t},n.frameRotation),i=ae(n),o="line"===n.type||"arrow"===n.type||"freehand"===n.type?6/le:0;if(r.x>=i.x-o&&r.x<=i.x+i.width+o&&r.y>=i.y-o&&r.y<=i.y+i.height+o)return n}return null})(t.x,t.y);if(!s){const e=((e,t)=>{const{x:a,y:s}=Mt({x:e,y:t},0);for(let n=Ne.length-1;n>=0;n--){const e=Ne[n];if(a>=e.x&&a<=e.x+e.width&&s>=e.y-e.height&&s<=e.y)return e}return null})(t.x,t.y);return e&&(Ce(e.id),Pe(e.str)),void ge(null)}ge(s.id);const n=a||Lt(t.x,t.y,s);if(n)return ye(!0),we(n),ve(ae(s)),Ft.current=s,void je(Mt(t,s.frameRotation));pe(!0);const r=Mt(t,s.frameRotation);return void je({x:r.x-s.x,y:r.y-s.y})}"freehand"===Fe?(Re(!0),Ee([t])):(Re(!0),je(t))},onMouseMove:e=>{const t=zt(e);if(ue&&xe&&fe){const e=de.find(e=>e.id===xe),a=e?Mt(t,e.frameRotation):t,n=a.x-be.x,r=a.y-be.y,i=de.map(e=>{if(e.id===xe){var t;let a=ke.x,i=ke.y,o=ke.width,l=ke.height;switch(fe){case"top-left":a=ke.x+n,i=ke.y+r,o=ke.width-n,l=ke.height-r;break;case"top-right":i=ke.y+r,o=ke.width+n,l=ke.height-r;break;case"bottom-left":a=ke.x+n,o=ke.width-n,l=ke.height+r;break;case"bottom-right":o=ke.width+n,l=ke.height+r}return o<10&&(o=10),l<10&&(l=10),((e,t,a,n)=>{const r=t.width?a.width/t.width:1,i=t.height?a.height/t.height:1,o=e=>a.x+(e-t.x)*r,l=e=>a.y+(e-t.y)*i,c=Math.hypot(a.width,a.height)/(Math.hypot(t.width,t.height)||1);if(q(e)){const a=(0,s.A)((0,s.A)({},e),{},{fontSize:Math.max(4,Z(e)*c)}),r=te(a),i=n&&n.includes("left")?t.x+t.width-r.width:t.x,o=n&&n.includes("top")?t.y+t.height-r.height:t.y;return se((0,s.A)((0,s.A)({},a),{},{width:r.width,height:r.height}),i-r.x,o-r.y)}if("watermark"===e.type)return(0,s.A)((0,s.A)((0,s.A)({},e),a),{},{fontSize:Math.max(4,Z(e)*c)});if(("line"===e.type||"arrow"===e.type)&&void 0!==e.x2&&void 0!==e.y2){const t=o(e.x),a=l(e.y),n=o(e.x2),r=l(e.y2);return(0,s.A)((0,s.A)({},e),{},{x:t,y:a,x2:n,y2:r,width:Math.abs(n-t),height:Math.abs(r-a)})}return"freehand"===e.type&&e.points?(0,s.A)((0,s.A)((0,s.A)({},e),a),{},{points:e.points.map(e=>({x:o(e.x),y:l(e.y)}
1))}):(0,s.A)((0,s.A)({},e),a)})(null!==(t=Ft.current)&&void 0!==t?t:e,ke,{x:a,y:i,width:o,height:l},fe)}return e});he(i)}else if(me&&xe){const e=de.map(e=>{if(e.id===xe){const a=Mt(t,e.frameRotation);return se(e,a.x-be.x-e.x,a.y-be.y-e.y)}return e});he(e)}else Ie&&"freehand"===Fe&&Ee([...Te,t])},onMouseUp:e=>{const t=zt(e);if(ue)ye(!1),we(null),It(de);else if(me)pe(!1),It(de);else if(Ie&&Fe){const e=_t(Fe,be,t);if(e){const t=[...de,e];he(t),It(t)}Re(!1),Ee([]),Me(null)}},className:"mx-auto cursor-crosshair"}),Se&&(0,O.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-white border-t-2 border-blue-500 p-4 shadow-lg",children:[(0,O.jsxs)("div",{className:"flex items-center gap-3",children:[(0,O.jsxs)("div",{className:"flex-1",children:[(0,O.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Edit Text (Click on any text in the PDF to edit it)"}),(0,O.jsx)("input",{type:"text",value:De,onChange:e=>Pe(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Bt(),"Escape"===e.key&&Yt()},className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter new text",autoFocus:!0})]}),(0,O.jsx)("button",{onClick:Bt,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Save"}),(0,O.jsx)("button",{onClick:Yt,className:"px-4 py-2 bg-gray-300 text-gray-700 rounded-lg hover:bg-gray-400 transition-colors",children:"Cancel"})]}),(0,O.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Press Enter to save, Esc to cancel"})]})]}),Fe&&(0,O.jsxs)("div",{className:"mt-4 p-3 bg-blue-50 rounded-lg text-sm text-blue-900",children:["text"===Fe&&We&&"Click to place text. Drag to move after placing.","text"===Fe&&!We&&"Enter text in the sidebar, then click to place",("rectangle"===Fe||"circle"===Fe)&&"Click and drag to draw shape",("line"===Fe||"arrow"===Fe)&&"Click and drag to draw","freehand"===Fe&&"Click and drag to draw freely","highlight"===Fe&&"Click and drag to highlight area"]}),(0,O.jsxs)("div",{className:"mt-4 p-3 bg-gray-50 rounded-lg text-xs text-gray-600",children:[(0,O.jsx)("p",{className:"font-semibold mb-1",children:"Keyboard Shortcuts:"}),(0,O.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,O.jsx)("span",{children:"\u2022 Undo: Ctrl+Z"}),(0,O.jsx)("span",{children:"\u2022 Redo: Ctrl+Y"}),(0,O.jsx)("span",{children:"\u2022 Copy: Ctrl+C"}),(0,O.jsx)("span",{children:"\u2022 Delete: Del"})]})]})]})})]}):(0,O.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,O.jsxs)("div",{onClick:()=>{var e;return null===(e=At.current)||void 0===e?void 0:e.click()},className:"border-4 border-dashed border-gray-300 rounded-lg p-12 text-center hover:border-primary-500 transition-colors cursor-pointer bg-white",children:[(0,O.jsx)(W.A,{className:"w-16 h-16 mx-auto text-gray-400 mb-4"}),(0,O.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Upload Your PDF"}),(0,O.jsx)("p",{className:"text-gray-600 mb-4",children:"Click to browse or drag and drop your PDF file here"}),(0,O.jsx)("p",{className:"text-sm text-gray-500",children:"No file size limit \u2022 Files processed locally \u2022 100% secure"}),(0,O.jsx)("input",{ref:At,type:"file",accept:".pdf",onChange:async e=>{var a;const s=null===(a=e.target.files)||void 0===a?void 0:a[0];if(!s||"application/pdf"!==s.type)return void alert("Please upload a valid PDF file");t(s);const{pdfjsLib:n,PDFDocument:r}=await Y(),i=await s.arrayBuffer(),o=i.slice(0),l=i.slice(0),c=n.getDocument({data:o}),d=await c.promise;B(d),oe(d.numPages),re(1);const h=await r.load(l);ee(h)},className:"hidden"})]}),(0,O.jsxs)("div",{className:"mt-12 grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,O.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-sm text-center",children:[(0,O.jsx)(R.A,{className:"w-8 h-8 mx-auto text-primary-600 mb-3"}),(0,O.jsx)("h4",{className:"font-semibold mb-2",children:"Text & Formatting"}),(0,O.jsx)("p",{className:"text-sm text-gray-600",children:"Add text with custom fonts, sizes, colors, bold, italic, underline. Fully draggable."})]}),(0,O.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-sm text-center",children:[(0,O.jsx)(p.A,{className:"w-8 h-8 mx-auto text-primary-600 mb-3"}),(0,O.jsx)("h4",{className:"font-semibold mb-2",children:"Stamps & Annotations"}),(0,O.jsx)("p",{className:"text-sm text-gray-600",children:"Checkmarks, X marks, date stamps, sticky notes, watermarks, page numbers"})]}),(0,O.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-sm text-center",children:[(0,O.jsx)(P.A,{className:"w-8 h-8 mx-auto text-primary-600 mb-3"}),(0,O.jsx)("h4",{className:"font-semibold mb-2",children:"Shapes & Signatures"}),(0,O.jsx)("p",{className:"text-sm text-gray-600",children:"Rectangles, circles, lines, arrows, highlights, freehand drawing, digital signatures"})]})]})]}),(0,O.jsxs)("div",{className:"mt-12 bg-white rounded-lg shadow-sm p-8",children:[(0,O.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Professional PDF Editor - Free Forever"}),(0,O.jsxs)("div",{className:"prose max-w-none",children:[(0,O.jsx)("p",{className:"text-gray-700 mb-4",children:"Edit PDFs like a pro with our advanced online PDF editor. Features drag-and-drop annotations, rich text formatting, shapes, digital signatures, and more. Completely free with no limitations."}),(0,O.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mt-6 mb-3",children:"Advanced Features"}),(0,O.jsxs)("ul",{className:"list-disc list-inside space-y-2 text-gray-700",children:[(0,O.jsx)("li",{children:"Draggable and resizable annotations"}),(0,O.jsx)("li",{children:"Rich text formatting: fonts, sizes, colors, bold, italic, underline"}),(0,O.jsx)("li",{children:"Drawing tools: rectangles, circles, lines, arrows, freehand"}),(0,O.jsx)("li",{children:"Digital signature support"}),(0,O.jsx)("li",{children:"Undo/Redo with keyboard shortcuts"}),(0,O.jsx)("li",{children:"Copy and delete annotations"}),(0,O.jsx)("li",{children:"Insert images and logos"}),(0,O.jsx)("li",{children:"Page management: rotate and delete"}),(0,O.jsx)("li",{children:"100% client-side processing for privacy"}),(0,O.jsx)("li",{children:"No watermarks or file size limits"})]}),(0,O.jsx)("p",{className:"text-gray-700 mt-6",children:"Unlike Adobe Acrobat, PDFescape, or Sejda, our PDF editor is completely free with all features unlocked. No subscriptions, no hidden costs. Start editing PDFs professionally today!"})]})]})]})]})}}}]);
2//# sourceMappingURL=2983.ac79c3ff.chunk.js.map

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.