PageSourceSearch

https://kerneltools.dev/assets/RotatePdf-C4AgloNs.js

js kerneltools.dev collected 2026-10-02 01:53:22 UTC 2,942 bytes, 1 lines download raw bytes

1import{r as a,u as P,j as e,L as b}from"./index-j7I9Tmll.js";import{P as j}from"./PdfPagePreview-or-1mmoF.js";import{P as y,d as D}from"./PDFButton-D40prZLX.js";import{i as w,M as F}from"./pdfEditor-C_FHqbws.js";import"./pdf.worker.min-DT7iqwIP.js";import"./browser-cLhBeQPl.js";function U(){const[o,h]=a.useState(null),[i,m]=a.useState(90),[n,p]=a.useState(!1),[g,u]=a.useState("Choose a PDF."),[f,d]=a.useState(""),[r,c]=a.useState(null);a.useEffect(()=>()=>{r&&URL.revokeObjectURL(r)},[r]),P({title:"Rotate PDF Pages Online Free | Kernel Tools",description:"Rotate PDF pages in your browser and download the result.",keywords:["rotate pdf","rotate pdf pages","pdf page rotation"],structuredData:{"@context":"https://schema.org","@type":"SoftwareApplication",name:"Rotate PDF",applicationCategory:"UtilitiesApplication",operatingSystem:"Web",url:"https://kerneltools.dev/rotate-pdf",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}}});async function x(){try{p(!0),c(null),d("");const t=await y.load(new Uint8Array(await o.arrayBuffer()),{updateMetadata:!1});
1t.getPages().forEach(l=>l.setRotation(D((l.getRotation().angle+i)%360)));const s=await t.save({updateMetadata:!1});c(URL.createObjectURL(new Blob([s],{type:"application/pdf"}))),u("Rotated PDF ready.")}catch(t){d(t.message||"Could not rotate this PDF.")}finally{p(!1)}}return e.jsxs("div",{className:"pdf-tools-page",children:[e.jsx(b,{className:"pdf-tools-back",to:"/pdf-tools",children:"← All PDF tools"}),e.jsxs("header",{className:"pdf-tools-heading",children:[e.jsx("h1",{children:"Rotate PDF"}),e.jsx("p",{children:"Rotate every PDF page."})]}),e.jsxs("section",{className:"pdf-tool-workspace pdf-rotation-desk","aria-label":"Rotation workspace",children:[e.jsxs("div",{className:"pdf-rotation-controls",children:[e.jsx("input",{hidden:!0,type:"file",accept:"application/pdf,.pdf",onChange:t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];if(!s||!w(s)||s.size>F)return d("Choose a PDF up to 100 MB.");h(s),c(null),d("")}}),e.jsx("button",{className:"btn btn-primary",disabled:n,onClick:t=>t.currentTarget.previousSibling.click(),children:"Choose PDF"}),e.jsxs("label",{children:["Rotation ",e.jsxs("select",{disabled:n,value:i,onChange:t=>{m(Number(t.target.value)),c(null),u("Rotation changed. Create a new output.")},children:[e.jsx("option",{value:"90",children:"90° clockwise"}),e.jsx("option",{value:"180",children:"180°"}),e.jsx("option",{value:"270",children:"270° clockwise"})]})]}),o&&e.jsx("button",{className:"btn btn-primary",disabled:n,onClick:x,children:"Rotate PDF"}),r&&e.jsx("a",{className:"btn btn-primary",href:r,download:"rotated.pdf",children:"Download PDF"}),o&&e.jsx("p",{className:"pdf-rotation-filename",children:o.name})]}),e.jsx(j,{file:o,rotation:i,disabled:n,title:`Proposed orientation · ${i}° clockwise`}),e.jsx("p",{role:"status",children:g}),f&&e.jsx("p",{className:"pdf-tool-error",children:f})]})]})}export{U 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.