PageSourceSearch

https://www.ihatepdf.cv/assets/MarkdownToPdfTool-B1i24Kvo.js

js ihatepdf.cv collected 2026-09-30 17:25:28 UTC 28,979 bytes, 180 lines download raw bytes

1import{r as p,j as e}from"./react-vendor-D653VjAu.js";function te(t){const o=[],i=/^[ \t]{0,3}(`{3,}|~{3,})[^\n]*\n[\s\S]*?(?:^[ \t]{0,3}\1[^\n]*$|$)/gm;let n;for(;n=i.exec(t);)o.push([n.index,n.index+n[0].length]);const s=/(`+)(?:[^`]|(?!\1)`)*\1/g;for(;n=s.exec(t);){const d=n.index,m=n.index+n[0].length;o.some(([c,r])=>d>=c&&m<=r)||o.push([d,m])}return o}const se=(t,o)=>t.some(([i,n])=>o>=i&&o<n);function ne(t){const o=te(t),i=[];let n="",s=0;const d=(m,c)=>{const r=`xMATHx${i.length}xENDx`;return i.push({id:r,tex:m,display:c}),r};for(;s<t.length;){const m=t[s];if(m==="\\"&&t[s+1]==="$"){n+="\\$",s+=2;continue}if(se(o,s)){n+=m,s++;continue}if(m==="\\"&&(t[s+1]==="["||t[s+1]==="(")){const c=t[s+1]==="[",r=c?"\\]":"\\)",h=t.indexOf(r,s+2);if(h!==-1){n+=d(t.slice(s+2,h).trim(),c),s=h+2;continue}}if(m==="$")if(t[s+1]==="$"){const c=t.indexOf("$$",s+2);if(c!==-1){n+=d(t.slice(s+2,c).trim(),!0),s=c+2;continue}}else{const c=t.slice(s+1),r=/^(?!\s)((?:\\\$|[^$\n]|\n(?!\s*\n))*?)(?<!\s)\$/.exec(c);if(r&&r[1].trim()){const h=t[s+1+r[0].length];if(!(h&&/\d/.test(h))){n+=d(r[1].trim(),!1),s+=1+r[0].length;continue}}}n+=m,s++}return{text:n,nodes:i}}const ae=t=>t.replace(/[&<>]/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[o]);function ie(t,o,i){let n=t;for(const s of o){let d;try{d=i(s.tex,s.display)}catch(m){d=`<code class="math-error" title="${String(m.message||m).replace(/"/g,"'")}">`+ae(s.tex)+"</code>"}s.display&&(n=n.replace(new RegExp(`<p>\\s*${s.id}\\s*</p>`,"g"),d)),n=n.split(s.id).join(d)}return n}const W="0.16.11",oe=`https://cdn.jsdelivr.net/npm/katex@${W}/dist/katex.min.css`,re=`https://cdn.jsdelivr.net/npm/katex@${W}/dist/katex.min.js`,le="https://cdn.jsdelivr.net/npm/marked@12/marked.min.js",de="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11/highlight.min.js",ce="https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11/styles/github.min.css",S=new Map;function $(t){if(S.has(t))return S.get(t);const o=new Promise((i,n)=>{const s=document.createElement("script");s.src=t,s.async=!0,s.onload=()=>i(),s.onerror=()=>{S.delete(t),n(new Error(`Could not load ${t}`))},document.head.appendChild(s)});return S.set(t,o),o}async function me(){const t=[];typeof window.marked>"u"&&t.push($(le)),typeof window.katex>"u"&&t.push($(re)),typeof window.hljs>"u"&&t.push($(de)),await Promise.all(t)}const he=t=>t.toLowerCase().replace(/<[^>]*>/g,"").replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-").slice(0,60)||"section";function xe(t,{number:o,minLevel:i=1,maxLevel:n=3}){const s=[...t.querySelectorAll("h1,h2,h3,h4,h5,h6")],d=[0,0,0,0,0,0],m=new Map,c=[];for(const r of s){const h=Number(r.tagName[1]);d[h-1]++;for(let u=h;u<d.length;u++)d[u]=0;let x=he(r.textContent);const w=(m.get(x)||0)+1;m.set(x,w),w>1&&(x=`${x}-${w}`),r.id=x;const f=d.slice(0,h).filter(u=>u>0).join(".");if(o&&h>=i&&h<=n&&f){const u=t.createElement("span");u.className="heading-number",u.textContent=`${f} `,r.insertBefore(u,r.firstChild)}h>=i&&h<=n&&c.push({level:h,id:x,label:f,text:r.textContent.trim()})}return c}function pe(t){if(!t.length)return"";const o=Math.min(...t.map(s=>s.level));let i="",n=o;for(const s of t){for(;n<s.level;)i+="<ol>",n++;for(;n>s.level;)i+="</ol>",n--;i+=`<li><a href="#${s.id}"><span class="toc-text">${s.text}</span></a></li>`}for(;n>=o;)i+="</ol>",n--;return`<nav class="toc" role="doc-toc"><h2 class="toc-title">Contents</h2>${i}</nav>`}function ge(t,o={}){const{math:i=!0,highlight:n=!0,numberHeadings:s=!1,toc:d=!1,tocDepth:m=3}=o,{text:c,nodes:r}=i?ne(t):{text:t,nodes:[]};window.marked.setOptions({gfm:!0,breaks:!1,headerIds:!1,mangle:!1});let h=window.marked.parse(c);r.length&&(h=ie(h,r,(g,j)=>window.katex.renderToString(g,{displayMode:j,throwOnError:!0,strict:!1,trust:!1,macros:{"\\RR":"\\mathbb{R}","\\NN":"\\mathbb{N}","\\ZZ":"\\mathbb{Z}"}})));const x=document.implementation.createHTMLDocument("");x.body.innerHTML=h;const w=xe(x,{number:s,maxLevel:m});if(n&&window.hljs)for(const g of x.querySelectorAll("pre code"))try{const v=[...g.classList].find(N=>N.startsWith("language-"))?.slice(9),M=v&&window.hljs.getLanguage(v)?window.hljs.highlight(g.textContent,{language:v}):window.hljs.highlightAuto(g.textContent);g.innerHTML=M.value,g.classList.add("hljs")}catch{}for(const g of x.querySelectorAll("table")){const j=x.createElement("div");j.className="table-wrap",g.parentNode.insertBefore(j,g),j.appendChild(g)}const f=x.body.innerHTML,u=x.body.textContent.trim().split(/\s+/).filter(
1Boolean).length;return{html:(d?pe(w):"")+f,outline:w,mathCount:r.length,wordCount:u}}function ue({fontSize:t=11,lineSpacing:o=1.6,fontFamily:i="serif",marginTop:n=54,marginRight:s=54,marginBottom:d=54,marginLeft:m=54}={}){const c={serif:'Georgia, "Iowan Old Style", "Times New Roman", Times, serif',sans:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',mono:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},r=c[i]||c.serif;return`
2    @page { size: A4; margin: ${n}pt ${s}pt ${d}pt ${m}pt; }
3    * { box-sizing: border-box; }
4    html, body { margin: 0; padding: 0; }
5    body {
6      font-family: ${r};
7      font-size: ${t}pt;
8      line-height: ${o};
9      color: #1a1a1a;
10      background: #fff;
11      -webkit-font-smoothing: antialiased;
12      text-rendering: optimizeLegibility;
13      hyphens: auto;
14    }
15
16    /* ── headings ─────────────────────────────────────────────────────── */
17    h1, h2, h3, h4, h5, h6 {
18      font-family: ${r};
19      color: #111;
20      line-height: 1.25;
21      margin: 1.4em 0 0.5em;
22      break-after: avoid;
23      page-break-after: avoid;
24      break-inside: avoid;
25    }
26    h1 { font-size: 2em;   margin-top: 0; letter-spacing: -0.01em; }
27    h2 { font-size: 1.55em; border-bottom: 1px solid #e5e5e5; padding-bottom: 0.25em; }
28    h3 { font-size: 1.25em; }
29    h4 { font-size: 1.08em; }
30    h5, h6 { font-size: 1em; color: #444; }
31    .heading-number { color: #666; font-variant-numeric: tabular-nums; }
32
33    /* ── body ─────────────────────────────────────────────────────────── */
34    p { margin: 0 0 0.85em; orphans: 3; widows: 3; }
35    strong { font-weight: 700; }
36    em { font-style: italic; }
37    a { color: #0b57d0; text-decoration: none; }
38    hr { border: 0; border-top: 1px solid #e0e0e0; margin: 2em 0; }
39    ul, ol { margin: 0 0 0.85em; padding-left: 1.6em; }
40    li { margin: 0.25em 0; orphans: 2; widows: 2; }
41    li > ul, li > ol { margin: 0.25em 0; }
42    li.task-list-item { list-style: none; margin-left: -1.3em; }
43    li.task-list-item input { margin-right: 0.5em; }
44
45    blockquote {
46      margin: 1.2em 0;
47      padding: 0.1em 1.2em;
48      border-left: 3px solid #d0d0d0;
49      color: #4a4a4a;
50      font-style: italic;
51      break-inside: avoid;
52    }
53
54    /* ── code ─────────────────────────────────────────────────────────── */
55    code, pre, kbd, samp { font-family: ${c.mono}; }
56    code {
57      background: #f4f4f5;
58      padding: 0.12em 0.35em;
59      border-radius: 3px;
60      font-size: 0.88em;
61      border: 1px solid #e8e8ea;
62    }
63    pre {
64      background: #f8f8fa;
65      border: 1px solid #e6e6e9;
66      border-radius: 6px;
67      padding: 0.9em 1.1em;
68      margin: 1.1em 0;
69      overflow-x: auto;
70      break-inside: avoid;
71      page-break-inside: avoid;
72      line-height: 1.5;
73    }
74    pre code { background: none; border: 0; padding: 0; font-size: 0.85em; }
75
76    /* ── tables ───────────────────────────────────────────────────────── */
77    .table-wrap { overflow-x: auto; margin: 1.2em 0; break-inside: avoid; }
78    table { border-collapse: collapse; width: 100%; font-size: 0.94em; }
79    th, td { border: 1px solid #dcdce0; padding: 0.45em 0.7em; text-align: left; vertical-align: top; }
80    th { background: #f6f6f8; font-weight: 700; }
81    tbody tr:nth-child(even) { background: #fafafb; }
82
83    img { max-width: 100%; height: auto; break-inside: avoid; }
84
85    /* ── maths ────────────────────────────────────────────────────────── */
86    /* Display equations move whole rather than being sliced by a page break,
87       and are given room to breathe the way a typeset document would. */
88    .katex-display {
89      margin: 1.2em 0;
90      break-inside: avoid;
91      page-break-inside: avoid;
92      overflow-x: auto;
93      overflow-y: hidden;
94      padding: 0.2em 0;
95    }
96    .katex { font-size: 1.05em; }
97    .katex-display > .katex { font-size: 1.12em; }
98    .math-error {
99      background: #fff1f2;
100      border: 1px solid #fecdd3;
101      color: #9f1239;
102    }
103
104    /* ── contents ─────────────────────────────────────────────────────── */
105    .toc {
106      margin: 0 0 2.2em;
107      padding: 0 0 1.4em;
108      border-bottom: 1px solid #e5e5e5;
109      break-after: page;
110      page-break-after: always;
111    }
112    .toc-title { font-size: 1.3em; margin: 0 0 0.6em; border: 0; padding: 0; }
113    .toc ol { list-style: none; padding-left: 1.1em; margin: 0.2em 0; counter-reset: toc; }
114    .toc > ol { padding-left: 0; }
115    .toc li { margin: 0.28em 0; counter-increment: toc; }
116    .toc a { color: #1a1a1a; text-decoration: none; }
117    .toc a::before { content: counters(toc, ".") "  "; color: #888; font-variant-numeric: tabular-nums; }
118
119    @media print {
120      body { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
121      a { color: #1a1a1a; }
122      /* A link's target is useless on paper, so show it once, small. */
123      a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #777; word-break: break-all; }
124      .toc a::after { content: none; }
125    }
126  `}const y=({children:t,className:o})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,children:t}),C=t=>e.jsxs(y,{...t,children:[e.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),e.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),be=t=>e.jsxs(y,{...t,children:[e.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),e.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),e.jsx("polyline",{points:"7 3 7 8 15 8"})]}),R=t=>e.jsxs(y,{...t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),B=t=>e.jsxs(y,{...t,children:[e.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),e.jsx("circle",{cx:"9",cy:"9",r:"2"}),e.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),q=t=>e.jsxs(y,{...t,children:[e.jsx("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),e.jsx("polyline",{points:"10 9 9 9 8 9"})]}),T=t=>e.jsxs(y,{...t,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),fe=t=>e.jsxs(y,{...t,children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),we=t=>e.jsxs(y,{...t,children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]});function F({checked:t,onChange:o,label:i,hint:n}){return e.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-colors ${t?"border-blue-600/50 bg-blue-600/10":"border-zinc-800 bg-zinc-950/50 hover:border-zinc-700"}`,children:[e.jsx("input",{type:"checkbox",checked:t,onChange:s=>o(s.target.checked),className:"mt-0.5 h-3.5 w-3.5 accent-blue-500"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-xs font-medium text-zinc-200",children:i}),e.jsx("span",{className:"mt-0.5 block text-[10px] leading-snug text-zinc-500",children:n})]})]})}const ye=({showNotification:t,showDownloadDialog:o})=>{const[i,n]=p.useState(""),[s,d]=p.useState(!1),[m,c]=p.useState(!1),[r,h]=p.useState(""),[x,w]=p.useState(11),[f,u]=p.useState(1.4),[g,j]=p.useState(72),[v,M]=p.useState(72),[N,V]=p.useState(72),[D,Y]=p.useState(72),[H,J]=p.useState(!0),[L,U]=p.useState(!1),[I,K]=p.useState(!1),[A,X]=p.useState("serif"),[E,G]=p.useState(!1),[k,Z]=p.useState(null);p.useEffect(()=>{let a=!1;return me().then(()=>!a&&G(!0)).catch(()=>t?.("Could not load the renderer. Check your connection.","error")),()=>{a=!0}},[]);const O=()=>{const a=ge(i,{math:H,highlight:!0,numberHeadings:I,toc:L});Z({math:a.mathCount,words:a.wordCount,headings:a.outline.length});const l=ue({fontSize:x,lineSpacing:f,fontFamily:A,marginTop:g,marginRight:D,marginBottom:v,marginLeft:N});return`<!DOCTYPE html><html><head><meta charset="UTF-8">
127<title>${(i.match(/^#\s+(.+)$/m)?.[1]||"Document").replace(/[<>]/g,"")}</title>
128<link rel="stylesheet" href="${oe}">
129<link rel="stylesheet" href="${ce}">
130<style>${l}</style></head><body>${a.html}</body></html>`};p.useEffect(()=>{},[]);const _=`# Markdown syntax guide
131
132## Headers
133
134# This is a Heading h1
135## This is a Heading h2
136###### This is a Heading h6
137
138## Emphasis
139
140*This text will be italic*  
141_This will also be italic_
142
143**This text will be bold**  
144__This will also be bold__
145
146_You **can** combine them_
147
148## Lists
149
150### Unordered
151
152* Item 1
153* Item 2
154  * Item 2a
155  * Item 2b
156
157### Ordered
158
1591. Item 1
1602. Item 2
1613. Item 3
162
163## Blockquotes
164
165> Markdown is a lightweight markup language with plain-text-formatting syntax.
166
167## Blocks of code
168
169\`\`\`javascript
170let message = 'Hello world';
171alert(message);
172\`\`\`
173
174## Inline code
175
176This web site is using \`markedjs/marked\`.
177
178---
179
180**Generated with ihatepdf**`,Q=()=>{if(!i.trim()){t("Please enter some markdown text","error");return}if(!E){t("The renderer is still loading. One moment.","error");return}try{h(O()),c(!0),t("Preview ready")}catch(a){t(`Could not render: ${a.message}`,"error")}},ee=async()=>{if(!i.trim()){t("Add some Markdown first","error");return}if(!E){t("The renderer is still loading. One moment.","error");return}d(!0);try{const a=O();document.getElementById("md-print-frame")?.remove();const l=document.createElement("iframe");l.id="md-print-frame",l.setAttribute("aria-hidden","true"),l.style.cssText="position:fixed;right:0;bottom:0;width:210mm;height:297mm;border:0;opacity:0;pointer-events:none;",document.body.appendChild(l);const b=l.contentDocument;b.open(),b.write(a),b.close(),await new Promise(z=>{const P=()=>z();b.readyState==="complete"?P():l.onload=P,setTimeout(P,4e3)});try{await l.contentDocument.fonts?.ready}catch{}await new Promise(z=>setTimeout(z,150)),l.contentWindow.focus(),l.contentWindow.print(),t("Print dialog open. Choose “Save as PDF”."),setTimeout(()=>l.remove(),6e4)}catch(a){t(`Could not build the document: ${a.message}`,"error")}finally{d(!1)}};return e.jsxs("article",{className:"max-w-7xl mx-auto space-y-6 md:space-y-8 pb-10",itemScope:!0,itemType:"https://schema.org/SoftwareApplication",children:[e.jsx("meta",{itemProp:"name",content:"Markdown to PDF Converter - ihatepdf"}),e.jsx("meta",{itemProp:"applicationCategory",content:"BusinessApplication"}),e.jsx("meta",{itemProp:"operatingSystem",content:"Any (Web-based)"}),e.jsxs("header",{className:"text-center pt-2",children:[e.jsx("h1",{className:"text-2xl md:text-4xl lg:text-5xl font-bold text-white mb-3",children:"Markdown to PDF Converter Free"}),e.jsxs("p",{className:"text-sm md:text-lg text-zinc-400 max-w-2xl mx-auto",children:["Convert markdown to beautifully formatted PDFs instantly."," ",e.jsx("span",{className:"text-zinc-200 font-semibold",children:"100% private — no upload required."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-xl p-4 md:p-6 shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 bg-zinc-800 border border-zinc-700 rounded-lg flex items-center justify-center",children:e.jsx(C,{className:"w-4 h-4 md:w-5 md:h-5 text-zinc-300"})}),e.jsx("h2",{className:"text-base md:text-xl font-semibold text-white",children:"Markdown Editor"})]}),e.jsx("button",{onClick:()=>n(_),className:"px-2.5 py-1.5 text-xs bg-zinc-800 hover:bg-zinc-700 text-zinc-300 rounded-lg transition-colors border border-zinc-700 touch-manipulation",children:"Load Sample"})]}),e.jsx("textarea",{value:i,onChange:a=>n(a.target.value),placeholder:"Enter your markdown here... (supports all standard markdown syntax)",className:"w-full h-64 md:h-96 bg-zinc-950 border border-zinc-800 rounded-lg px-3 py-2.5 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-500 font-mono resize-none"}),e.jsxs("div",{className:"mt-4 flex gap-2 md:gap-3",children:[e.jsxs("button",{onClick:Q,disabled:s||!i.trim(),className:"flex-1 py-2.5 bg-zinc-800 hover:bg-zinc-700 text-white rounded-lg font-medium disabled:opacity-50 transition-colors flex items-center justify-center gap-2 text-sm border border-zinc-700 touch-manipulation active:scale-[0.98]",children:[e.jsx(B,{className:"w-4 h-4"}),"Preview"]}),e.jsx("button",{onClick:ee,disabled:s||!i.trim(),className:"flex-1 py-2.5 bg-zinc-100 hover:bg-white text-zinc-900 rounded-lg font-semibold disabled:opacity-50 transition-all flex items-center justify-center gap-2 text-sm touch-manipulation active:scale-[0.98]",children:s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 border-2 border-zinc-400 border-t-zinc-900 rounded-full animate-spin"}),e.jsx("span",{className:"hidden sm:inline",children:"Processing..."}),e.jsx("span",{className:"sm:hidden",children:"..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4"}),"Save as PDF"]})})]})]}),e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4 md:p-6",children:[e.jsxs("h3",{className:"text-sm font-medium text-zinc-300 mb-4 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"PDF Formatting Settings"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[e.jsx(F,{checked:H,onChange:J,label:"LaTeX math",hint:"$inline$, $$display$$, \\\\(…\\\\), \\\\[…\\\\]"}),e.jsx(F,{checked:L,onChange:U,label:"Table of contents",hint:"Built from the real heading hierarchy"}),e.jsx(F,{checked:I,onChange:K,label:"Number headings",hint:"1, 1.1, 1.1.1"}),e.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg border border-zinc-800 bg-zinc-950/50 p-3",children:[e.jsx("label",{htmlFor:"md-typeface",className:"text-xs font-medium text-zinc-300",children:"Typeface"}),e.jsxs("select",{id:"md-typeface",value:A,onChange:a=>X(a.target.value),className:"rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-xs text-zinc-200",children:[e.jsx("option",{value:"serif",children:"Serif (for reading)"}),e.jsx("option",{value:"sans",children:"Sans (for screens)"}),e.jsx("option",{value:"mono",children:"Monospace"})]})]})]}),k&&e.jsxs("p",{className:"rounded-md border border-zinc-800 bg-zinc-950/50 px-3 py-2 text-[11px] text-zinc-500",children:[k.words.toLocaleStr
180ing()," words ·"," ",k.headings," headings ·"," ",e.jsxs("span",{className:k.math?"text-emerald-400":"",children:[k.math," equation",k.math===1?"":"s"," typeset"]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs text-zinc-500 mb-2",children:["Font Size: ",x,"pt"]}),e.jsx("input",{type:"range",min:"8",max:"16",value:x,onChange:a=>w(parseInt(a.target.value)),className:"w-full accent-zinc-400"}),e.jsxs("div",{className:"flex justify-between text-xs text-zinc-600 mt-1",children:[e.jsx("span",{children:"8pt"}),e.jsx("span",{children:"16pt"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs text-zinc-500 mb-2",children:["Line Spacing: ",f]}),e.jsx("input",{type:"range",min:"1",max:"2",step:"0.1",value:f,onChange:a=>u(parseFloat(a.target.value)),className:"w-full accent-zinc-400"}),e.jsxs("div",{className:"flex justify-between text-xs text-zinc-600 mt-1",children:[e.jsx("span",{children:"1.0"}),e.jsx("span",{children:"2.0"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-zinc-500 mb-2",children:"Page Margins (points)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 md:gap-3",children:[{label:"Top",val:g,set:j},{label:"Bottom",val:v,set:M},{label:"Left",val:N,set:V},{label:"Right",val:D,set:Y}].map(({label:a,val:l,set:b})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs text-zinc-600 mb-1",children:[a,": ",l,"pt"]}),e.jsx("input",{type:"number",value:l,onChange:z=>b(parseInt(z.target.value)||72),className:"w-full bg-zinc-950 border border-zinc-800 rounded px-2.5 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-1 focus:ring-zinc-600"})]},a))})]})]})]})]}),e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-xl p-4 md:p-6 shadow-lg",children:[e.jsxs("h3",{className:"text-sm font-medium text-zinc-300 mb-4 flex items-center gap-2",children:[e.jsx(B,{className:"w-4 h-4"}),"Live Preview"]}),m&&r?e.jsx("iframe",{srcDoc:r,className:"w-full bg-white rounded-lg border border-zinc-700",style:{height:"calc(100vh - 200px)",minHeight:"400px",border:"1px solid #3f3f46"},sandbox:"allow-same-origin",title:"Markdown Preview"}):e.jsx("div",{className:"flex items-center justify-center text-zinc-600 bg-zinc-950 rounded-lg border border-zinc-800",style:{minHeight:"320px"},children:e.jsxs("div",{className:"text-center p-6 md:p-8",children:[e.jsx(q,{className:"w-12 h-12 md:w-16 md:h-16 mx-auto mb-4 opacity-20"}),e.jsx("p",{className:"text-sm mb-2",children:"No preview yet"}),e.jsx("p",{className:"text-xs opacity-60",children:"Write markdown and click Preview"})]})})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-white mb-4",children:"Why Use Our Markdown to PDF Converter?"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 md:gap-4",children:[{Icon:C,title:"Live Preview",desc:"See your markdown rendered in real-time before converting to PDF. WYSIWYG experience for perfect results."},{Icon:T,title:"Full Markdown Support",desc:"Supports all standard markdown: headers, lists, tables, code blocks, blockquotes, images, and links."},{Icon:R,title:"Customizable Styling",desc:"Adjust font size, line spacing, and page margins to match your document requirements perfectly."},{Icon:fe,title:"100% Private & Secure",desc:"All processing happens in your browser. Your markdown content never leaves your device — guaranteed privacy."}].map(({Icon:a,title:l,desc:b})=>e.jsx("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4 md:p-5 hover:border-zinc-700 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-9 h-9 md:w-10 md:h-10 bg-zinc-800 border border-zinc-700 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(a,{className:"w-4 h-4 md:w-5 md:h-5 text-zinc-300"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-white mb-1 text-sm md:text-base",children:l}),e.jsx("p",{className:"text-xs md:text-sm text-zinc-400",children:b})]})]})},l))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-white mb-4",children:"How to Convert Markdown to PDF"}),e.jsx("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4 md:p-6",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-
1805 md:gap-6",children:[["Write or Paste Markdown",'Type your markdown in the editor or paste existing content. Click "Load Sample" to see example syntax.'],["Preview Your Document",'Click "Preview" to see how your markdown will look when converted. Make any adjustments needed.'],["Customize PDF Settings","Adjust font size, line spacing, and page margins in the settings panel below the editor."],["Save as PDF",'Click "Save as PDF" to open the print dialog. Choose "Save as PDF" as your printer to download.']].map(([a,l],b)=>e.jsxs("div",{className:"flex gap-3 md:flex-col md:text-center md:items-center",children:[e.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 bg-zinc-700 border border-zinc-600 text-white rounded-full flex items-center justify-center flex-shrink-0 font-bold text-sm md:text-base",children:b+1}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-white mb-1 text-sm",children:a}),e.jsx("p",{className:"text-xs text-zinc-400",children:l})]})]},b))})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-white mb-4",children:"Supported Markdown Syntax"}),e.jsx("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4 md:p-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5 md:gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-white mb-3 text-sm md:text-base",children:"Text Formatting"}),e.jsx("ul",{className:"space-y-2",children:[["Headers","# H1 through ###### H6"],["Bold","**text** or __text__"],["Italic","*text* or _text_"],["Strikethrough","~~text~~"],["Inline code","`code`"]].map(([a,l])=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-400",children:[e.jsx(T,{className:"w-4 h-4 text-zinc-500 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-zinc-300",children:a})," —"," ",l]})]},a))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-white mb-3 text-sm md:text-base",children:"Content Elements"}),e.jsx("ul",{className:"space-y-2",children:[["Links","[text](url)"],["Images","![alt](url)"],["Lists","Ordered and unordered"],["Blockquotes","> quote"],["Code blocks","```language"],["Tables","Full support"],["Horizontal rules","---"]].map(([a,l])=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-400",children:[e.jsx(T,{className:"w-4 h-4 text-zinc-500 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-zinc-300",children:a})," —"," ",l]})]},a))})]})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-bold text-white mb-4",children:"Common Use Cases"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 md:gap-4",children:[{Icon:q,title:"Documentation",desc:"Convert README files, technical docs, and API documentation from markdown to professional PDF format."},{Icon:C,title:"Blog Posts & Articles",desc:"Save blog posts and articles written in markdown as PDFs for offline reading or archiving."},{Icon:we,title:"Reports & Notes",desc:"Create formatted reports, meeting notes, or study guides from markdown and export as PDFs."}].map(({Icon:a,title:l,desc:b})=>e.jsxs("div",{className:"bg-zinc-900 border border-zinc-800 rounded-lg p-4 md:p-5 hover:border-zinc-700 transition-colors",children:[e.jsxs("h3",{className:"font-semibold text-white mb-2 flex items-center gap-2 text-sm md:text-base",children:[e.jsx(a,{className:"w-4 h-4 text-zinc-400"}),l]}),e.jsx("p",{className:"text-xs md:text-sm text-zinc-400",children:b})]},l))})]}),e.jsxs("section",{className:"bg-zinc-900 border border-zinc-800 rounded-xl p-5 md:p-6 text-center",children:[e.jsx("h2",{className:"text-lg md:text-xl font-bold text-white mb-2",children:"Ready to Convert Markdown to PDF?"}),e.jsx("p",{className:"text-zinc-400 text-sm mb-4",children:"Professional PDF documents from your markdown. Free, instant, and private."}),e.jsxs("button",{onClick:()=>n(_),className:"inline-flex items-center gap-2 px-5 py-2.5 bg-zinc-100 hover:bg-white text-zinc-900 rounded-lg font-semibold cursor-pointer transition-all text-sm touch-manipulation active:scale-[0.98]",children:[e.jsx(C,{className:"w-4 h-4"}),"Try Sample Markdown"]})]})]})};export{ye 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.