{"id":40183,"date":"2026-02-25T04:00:45","date_gmt":"2026-02-25T01:00:45","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/"},"modified":"2026-02-25T04:00:45","modified_gmt":"2026-02-25T01:00:45","slug":"node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/","title":{"rendered":"Node.js ile HTML&#8217;den PDF Olu\u015fturma (Puppeteer Olmadan)"},"content":{"rendered":"<h2>Node.js ile HTML&#8217;den PDF Olu\u015fturma (Puppeteer Olmadan)<\/h2>\n<p>Node.js uygulamalar\u0131nda HTML i\u00e7eri\u011fini PDF format\u0131na d\u00f6n\u00fc\u015ft\u00fcrme ihtiyac\u0131, fatura olu\u015fturmadan raporlamaya, bilet veya sertifika bas\u0131m\u0131na kadar pek \u00e7ok senaryoda kar\u015f\u0131m\u0131za \u00e7\u0131kar. Bu s\u00fcre\u00e7, kullan\u0131c\u0131ya sunulan dinamik verileri daha ta\u015f\u0131nabilir ve yazd\u0131r\u0131labilir bir formata d\u00f6n\u00fc\u015ft\u00fcrmenin etkili bir yoludur. Genellikle bu t\u00fcr g\u00f6revler i\u00e7in akla ilk gelen \u00e7\u00f6z\u00fcmlerden biri Puppeteer olsa da, bu g\u00fc\u00e7l\u00fc arac\u0131n beraberinde getirdi\u011fi baz\u0131 dezavantajlar bulunmaktad\u0131r. \u00d6zellikle sunucu ortamlar\u0131nda kaynak t\u00fcketimi ve kurulum karma\u015f\u0131kl\u0131\u011f\u0131, geli\u015ftiricileri Puppeteer d\u0131\u015f\u0131ndaki daha hafif ve ba\u011f\u0131ms\u0131z alternatiflere y\u00f6neltmektedir. Bu makalede, Puppeteer&#8217;\u0131n getirdi\u011fi y\u00fckten ka\u00e7\u0131narak Node.js ile HTML&#8217;den nas\u0131l PDF olu\u015fturabilece\u011fimizi, farkl\u0131 yakla\u015f\u0131mlar\u0131 ve pop\u00fcler k\u00fct\u00fcphaneleri detayl\u0131ca inceleyece\u011fiz.<\/p>\n<h3>Neden Puppeteer Olmadan PDF Olu\u015fturmal\u0131y\u0131z?<\/h3>\n<p>Puppeteer, Google Chrome&#8217;un headless (ba\u015fs\u0131z) modunu kullanarak web sayfalar\u0131n\u0131 otomatikle\u015ftiren g\u00fc\u00e7l\u00fc bir k\u00fct\u00fcphanedir. PDF olu\u015fturma konusunda da m\u00fckemmel sonu\u00e7lar verse de, baz\u0131 senaryolarda Puppeteer&#8217;s\u0131z bir yakla\u015f\u0131m tercih etmek daha ak\u0131ll\u0131ca olabilir.<\/p>\n<h4>Performans ve Kaynak T\u00fcketimi<\/h4>\n<p>Puppeteer, alt\u0131nda tam bir Chromium taray\u0131c\u0131 \u00f6rne\u011fini \u00e7al\u0131\u015ft\u0131r\u0131r. Bu durum, PDF olu\u015fturma i\u015flemi s\u0131ras\u0131nda \u00f6nemli miktarda CPU ve RAM kayna\u011f\u0131 t\u00fcketimine yol a\u00e7abilir. \u00d6zellikle yo\u011fun PDF olu\u015fturma talepleri olan sunucu ortamlar\u0131nda, her bir PDF iste\u011fi i\u00e7in yeni bir taray\u0131c\u0131 \u00f6rne\u011fi ba\u015flatmak veya mevcut \u00f6rne\u011fi y\u00f6netmek, sunucunun performans\u0131n\u0131 ciddi \u015fekilde etkileyebilir ve maliyetleri art\u0131rabilir. Daha az kaynak t\u00fcketen alternatifler, \u00f6l\u00e7eklenebilirlik a\u00e7\u0131s\u0131ndan b\u00fcy\u00fck avantaj sa\u011flar.<\/p>\n<h4>Ba\u011f\u0131ml\u0131l\u0131klar ve Kurulum Karma\u015f\u0131kl\u0131\u011f\u0131<\/h4>\n<p>Puppeteer&#8217;\u0131n \u00e7al\u0131\u015fabilmesi i\u00e7in sistemde uyumlu bir Chromium s\u00fcr\u00fcm\u00fcn\u00fcn bulunmas\u0131 veya indirilmesi gerekir. Bu, geli\u015ftirme ve \u00fcretim ortamlar\u0131 aras\u0131nda s\u00fcr\u00fcm uyumsuzluklar\u0131na, ek indirme s\u00fcrelerine ve farkl\u0131 i\u015fletim sistemlerinde (\u00f6zellikle Linux sunucularda gerekli olan ek k\u00fct\u00fcphaneler) kurulum sorunlar\u0131na yol a\u00e7abilir. Docker konteynerleri gibi izole ortamlarda bile, Chromium&#8217;un b\u00fcy\u00fck boyutu ve ba\u011f\u0131ml\u0131l\u0131klar\u0131, Docker imaj boyutunu art\u0131rarak da\u011f\u0131t\u0131m s\u00fcre\u00e7lerini yava\u015flatabilir.<\/p>\n<h4>Hafif ve Ba\u011f\u0131ms\u0131z \u00c7\u00f6z\u00fcm Aray\u0131\u015f\u0131<\/h4>\n<p>Baz\u0131 projelerde, sadece HTML&#8217;i PDF&#8217;e d\u00f6n\u00fc\u015ft\u00fcrmek gibi spesifik bir g\u00f6rev i\u00e7in tam bir taray\u0131c\u0131 motoruna ihtiya\u00e7 duyulmaz. Bu gibi durumlarda, daha az ba\u011f\u0131ml\u0131l\u0131\u011fa sahip, daha hafif ve kurulumu daha kolay \u00e7\u00f6z\u00fcmler aramak mant\u0131kl\u0131d\u0131r. Bu t\u00fcr \u00e7\u00f6z\u00fcmler, genellikle daha h\u0131zl\u0131 ba\u015flang\u0131\u00e7 s\u00fcreleri sunar ve genel sistem karma\u015f\u0131kl\u0131\u011f\u0131n\u0131 azalt\u0131r, bu da bak\u0131m ve hata ay\u0131klama s\u00fcre\u00e7lerini basitle\u015ftirir.<\/p>\n<h3>Temel Yakla\u015f\u0131mlar ve K\u00fct\u00fcphaneler<\/h3>\n<p>Puppeteer gibi bir headless taray\u0131c\u0131 kullanmadan HTML&#8217;den PDF olu\u015fturmak i\u00e7in farkl\u0131 stratejiler ve k\u00fct\u00fcphaneler mevcuttur. Bu yakla\u015f\u0131mlar genellikle altta yatan farkl\u0131 teknolojilere dayan\u0131r.<\/p>\n<h4>wkhtmltopdf Tabanl\u0131 \u00c7\u00f6z\u00fcmler<\/h4>\n<p><code>wkhtmltopdf<\/code>, WebKit rendering engine&#8217;ini (Chrome&#8217;un eski versiyonlar\u0131n\u0131n kulland\u0131\u011f\u0131 motor) kullanarak HTML&#8217;i PDF&#8217;e veya g\u00f6r\u00fcnt\u00fcye d\u00f6n\u00fc\u015ft\u00fcren a\u00e7\u0131k kaynakl\u0131 bir komut sat\u0131r\u0131 arac\u0131d\u0131r. Puppeteer&#8217;dan farkl\u0131 olarak, <code>wkhtmltopdf<\/code> tam bir taray\u0131c\u0131 de\u011fildir; daha \u00e7ok bir d\u00f6n\u00fc\u015ft\u00fcrme motorudur. Node.js ekosisteminde, bu arac\u0131 sarmalayan (wrapper) k\u00fct\u00fcphaneler olduk\u00e7a pop\u00fclerdir.<\/p>\n<p>*   <strong>Art\u0131lar\u0131:<\/strong> Genellikle iyi bir HTML ve CSS deste\u011fi sunar, Puppeteer&#8217;a g\u00f6re daha az kaynak t\u00fcketir ve kurulumu daha basittir (sadece <code>wkhtmltopdf<\/code> ikili dosyas\u0131n\u0131n sistemde bulunmas\u0131 yeterlidir).<br \/>\n*   <strong>Eksileri:<\/strong> WebKit motoru modern taray\u0131c\u0131lardan biraz daha eski oldu\u011fu i\u00e7in, en yeni CSS \u00f6zellikleri veya JavaScript API&#8217;leri i\u00e7in tam destek sunmayabilir. Ayr\u0131ca, <code>wkhtmltopdf<\/code>&#8216;in kendisinin sistemde y\u00fckl\u00fc olmas\u0131 bir d\u0131\u015f ba\u011f\u0131ml\u0131l\u0131kt\u0131r.<\/p>\n<h4>HTML Ayr\u0131\u015ft\u0131rma ve PDF K\u00fct\u00fcphaneleri<\/h4>\n<p>Bu yakla\u015f\u0131m, HTML i\u00e7eri\u011fini ayr\u0131\u015ft\u0131r\u0131p (parse edip) do\u011frudan PDF format\u0131na yazan k\u00fct\u00fcphaneleri i\u00e7erir. <code>pdfkit<\/code> gibi k\u00fct\u00fcphaneler, Node.js ortam\u0131nda programatik olarak PDF belgeleri olu\u015fturmak i\u00e7in tasarlanm\u0131\u015ft\u0131r. Ancak, <code>pdfkit<\/code> do\u011frudan HTML&#8217;i PDF&#8217;e d\u00f6n\u00fc\u015ft\u00fcrme yetene\u011fine sahip de\u011fildir. Bunun yerine, HTML&#8217;i ayr\u0131\u015ft\u0131r\u0131p (\u00f6rne\u011fin, bir DOM parser ile) i\u00e7eri\u011fi (metin, resimler, tablolar) \u00e7\u0131karman\u0131z ve ard\u0131ndan bu i\u00e7eri\u011fi <code>pdfkit<\/code> API&#8217;lerini kullanarak PDF belgesine manuel olarak yerle\u015ftirmeniz gerekir.<\/p>\n<p>*   <strong>Art\u0131lar\u0131:<\/strong> Tam kontrol sa\u011flar, d\u0131\u015f ba\u011f\u0131ml\u0131l\u0131klar\u0131 minimuma indirir (sadece Node.js k\u00fct\u00fcphaneleri).<br \/>\n*   <strong>Eksileri:<\/strong> HTML&#8217;den PDF&#8217;e d\u00f6n\u00fc\u015ft\u00fcrme mant\u0131\u011f\u0131n\u0131 s\u0131f\u0131rdan yazmak, \u00f6zellikle karma\u015f\u0131k HTML ve CSS yap\u0131lar\u0131nda olduk\u00e7a zaman al\u0131c\u0131 ve zahmetli olabilir. Stil ve d\u00fczeni korumak \u00e7ok zordur.<\/p>\n<h4>Di\u011fer Alternatifler (K\u0131sa Bahis)<\/h4>\n<p>*   <strong><code>phantomjs<\/code> Tabanl\u0131 \u00c7\u00f6z\u00fcmler:<\/strong> <code>phantomjs<\/code> de headless WebKit tabanl\u0131 bir taray\u0131c\u0131yd\u0131. Ancak projesi 2018&#8217;den beri aktif olarak geli\u015ftirilmemektedir ve g\u00fcn\u00fcm\u00fcz modern web standartlar\u0131 i\u00e7in yetersiz kalmaktad\u0131r. Bu nedenle yeni projelerde tercih edilmemelidir.<br \/>\n*   <strong>Ticari API&#8217;ler ve Mikroservisler:<\/strong> Baz\u0131 durumlarda, PDF olu\u015fturma i\u015flemini bir \u00fc\u00e7\u00fcnc\u00fc taraf API&#8217;ye veya ayr\u0131 bir mikroservise devretmek mant\u0131kl\u0131 olabilir. \u00d6rne\u011fin, Gotenberg (Docker tabanl\u0131 bir PDF d\u00f6n\u00fc\u015ft\u00fcrme mikroservisi) veya DocRaptor gibi ticari hizmetler, y\u00fcksek \u00f6l\u00e7eklenebilirlik ve bak\u0131m kolayl\u0131\u011f\u0131 sunabilir. Bu \u00e7\u00f6z\u00fcmler genellikle kendi taray\u0131c\u0131 motorlar\u0131n\u0131 veya <code>wkhtmltopdf<\/code> gibi ara\u00e7lar\u0131 arka planda kullan\u0131r.<\/p>\n<h3>html-pdf K\u00fct\u00fcphanesi ile Ad\u0131m Ad\u0131m PDF Olu\u015fturma<\/h3>\n<p>Node.js ekosisteminde <code>wkhtmltopdf<\/code> tabanl\u0131 \u00e7\u00f6z\u00fcmler aras\u0131nda en pop\u00fcler ve kullan\u0131m\u0131 kolay olanlardan biri <code>html-pdf<\/code> k\u00fct\u00fcphanesidir. Bu k\u00fct\u00fcphane, HTML stringlerini veya dosyalar\u0131n\u0131 kolayca PDF&#8217;e d\u00f6n\u00fc\u015ft\u00fcrmenizi sa\u011flar.<\/p>\n<h4>html-pdf Nedir ve Nas\u0131l \u00c7al\u0131\u015f\u0131r?<\/h4>\n<p><code>html-pdf<\/code> k\u00fct\u00fcphanesi, ad\u0131ndan da anla\u015f\u0131laca\u011f\u0131 gibi HTML i\u00e7eri\u011fini PDF&#8217;e d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in tasarlanm\u0131\u015ft\u0131r. Temel olarak, sisteminizde y\u00fckl\u00fc olan <code>wkhtmltopdf<\/code> ikili dosyas\u0131n\u0131 Node.js \u00fczerinden \u00e7a\u011f\u0131rarak bu d\u00f6n\u00fc\u015ft\u00fcrme i\u015flemini ger\u00e7ekle\u015ftirir. E\u011fer <code>wkhtmltopdf<\/code> y\u00fckl\u00fc de\u011filse veya k\u00fct\u00fcphane onu bulamazsa, varsay\u0131lan olarak <code>phantomjs<\/code>&#8216;i kullanmaya \u00e7al\u0131\u015f\u0131r (ancak bu, yukar\u0131da belirtildi\u011fi gibi art\u0131k \u00f6nerilmez). Bu nedenle, <code>html-pdf<\/code> kullan\u0131rken <code>wkhtmltopdf<\/code>&#8216;in do\u011fru \u015fekilde kurulu ve eri\u015filebilir oldu\u011fundan emin olmak kritik \u00f6neme sahiptir.<\/p>\n<h4>Kurulum ve Temel Kullan\u0131m<\/h4>\n<p>\u0130lk ad\u0131m olarak, <code>html-pdf<\/code> k\u00fct\u00fcphanesini projenize eklemeniz gerekir:<\/p>\n<pre><code class=\"language-bash\">npm install html-pdf<\/pre>\n<p><\/code><\/p>\n<p>Ard\u0131ndan, <code>wkhtmltopdf<\/code>'in sisteminizde kurulu oldu\u011fundan emin olun. Kurulum talimatlar\u0131 i\u015fletim sisteminize g\u00f6re de\u011fi\u015fir:<\/p>\n<p>*   <strong>Linux (Debian\/Ubuntu):<\/strong><\/p>\n<pre><code class=\"language-bash\">sudo apt-get update\n    sudo apt-get install wkhtmltopdf<\/pre>\n<p><\/code><br \/>\n    *Not: Baz\u0131 da\u011f\u0131t\u0131mlarda <code>wkhtmltopdf<\/code>'in varsay\u0131lan s\u00fcr\u00fcm\u00fc eski olabilir veya ba\u015fl\u0131k\/altbilgi gibi \u00f6zellikler i\u00e7in tam destek sunmayabilir. Bu durumda, resmi web sitesinden statik olarak derlenmi\u015f s\u00fcr\u00fcm\u00fc indirip <code>\/usr\/local\/bin<\/code> gibi bir yere kopyalaman\u0131z gerekebilir.*<br \/>\n*   <strong>macOS:<\/strong><\/p>\n<pre><code class=\"language-bash\">brew install wkhtmltopdf<\/pre>\n<p><\/code><br \/>\n*   <strong>Windows:<\/strong><br \/>\n    <code>wkhtmltopdf<\/code>'in resmi web sitesinden (wkhtmltopdf.org) kurulum dosyas\u0131n\u0131 indirip kurman\u0131z yeterlidir. Kurulum s\u0131ras\u0131nda PATH'e ekledi\u011finizden emin olun.<\/p>\n<p>\u015eimdi basit bir HTML string'inden PDF olu\u015fturma \u00f6rne\u011fine bakal\u0131m:<\/p>\n<pre><code class=\"language-javascript\">const pdf = require('html-pdf');\nconst fs = require('fs');\n\nconst htmlContent = <code><h1>Merhaba D\u00fcnya!<\/h1>\n    <p>Bu, Node.js ile HTML'den olu\u015fturulmu\u015f basit bir PDF belgesidir.<\/p>\n    <ul>\n        <li>\u00d6\u011fe 1<\/li>\n        <li>\u00d6\u011fe 2<\/li>\n        <li>\u00d6\u011fe 3<\/li>\n    <\/ul>\n    <style>\n        h1 { color: #3498db; font-family: Arial, sans-serif; }\n        p { font-family: 'Times New Roman', serif; line-height: 1.5; }\n        ul { list-style-type: square; }\n    <\/style><\/code>;\n\nconst options = {\n    format: 'A4',\n    orientation: 'portrait',\n    border: '10mm'\n};\n\npdf.create(htmlContent, options).toFile('.\/output.pdf', function(err, res) {\n    if (err) return console.log(err);\n    console.log(res); \/\/ { filename: '\/path\/to\/output.pdf' }\n    console.log('PDF ba\u015far\u0131yla olu\u015fturuldu!');\n});<\/pre>\n<p><\/code><\/p>\n<p>Bu kod par\u00e7as\u0131, <code>htmlContent<\/code> de\u011fi\u015fkenindeki HTML string'ini al\u0131p, belirtilen se\u00e7eneklerle <code>output.pdf<\/code> ad\u0131nda bir dosya olu\u015fturur.<\/p>\n<h4>Se\u00e7enekler ve \u00d6zelle\u015ftirme<\/h4>\n<p><code>html-pdf<\/code> k\u00fct\u00fcphanesi, PDF \u00e7\u0131kt\u0131s\u0131n\u0131 \u00f6zelle\u015ftirmek i\u00e7in zengin bir <code>options<\/code> nesnesi sunar. \u0130\u015fte s\u0131k\u00e7a kullan\u0131lan baz\u0131 se\u00e7enekler:<\/p>\n<p>*   <code>format<\/code>: Sayfa boyutu (\u00f6rne\u011fin, 'A4', 'Letter', 'Tabloid').<br \/>\n*   <code>orientation<\/code>: Sayfa y\u00f6n\u00fc ('portrait' veya 'landscape').<br \/>\n*   <code>border<\/code>: Sayfa kenar bo\u015fluklar\u0131 (\u00f6rne\u011fin, '10mm', '0.5in', { top: '1in', right: '1in', bottom: '1in', left: '1in' }).<br \/>\n*   <code>header<\/code>: Ba\u015fl\u0131k i\u00e7eri\u011fi ve y\u00fcksekli\u011fi.<br \/>\n*   <code>footer<\/code>: Altbilgi i\u00e7eri\u011fi ve y\u00fcksekli\u011fi.<br \/>\n*   <code>base<\/code>: HTML i\u00e7inde g\u00f6receli yollarla belirtilen resimler veya CSS dosyalar\u0131 i\u00e7in temel URL.<br \/>\n*   <code>zoom<\/code>: PDF i\u00e7eri\u011finin yak\u0131nla\u015ft\u0131rma seviyesi.<br \/>\n*   <code>timeout<\/code>: PDF olu\u015fturma i\u015flemi i\u00e7in maksimum s\u00fcre.<\/p>\n<p>\u00d6rnek bir <code>options<\/code> nesnesi:<\/p>\n<pre><code class=\"language-javascript\">const options = {\n    format: 'A4',\n    orientation: 'portrait',\n    border: {\n        top: '1in',\n        right: '1in',\n        bottom: '1in',\n        left: '1in'\n    },\n    header: {\n        height: '20mm',\n        contents: '<div style=\"text-align: center; color: #f00;\">\u00dcst Bilgi<\/div>'\n    },\n    footer: {\n        height: '20mm',\n        contents: {\n            first: 'Sayfa 1',\n            2: '\u0130kinci Sayfa', \/\/ sayfa 2\n            default: '<span style=\"color: #444;\">{{page}}<\/span>\/<span>{{pages}}<\/span>', \/\/ varsay\u0131lan\n            last: 'Son Sayfa'\n        }\n    },\n    \/\/ wkhtmltopdf'in yolunu manuel olarak belirtmek isterseniz:\n    \/\/ phantomPath: '\/usr\/local\/bin\/phantomjs', \/\/ E\u011fer wkhtmltopdf kullanm\u0131yorsan\u0131z\n    \/\/ wkhtmltopdf: '\/usr\/local\/bin\/wkhtmltopdf' \/\/ wkhtmltopdf yolunu belirtmek i\u00e7in\n};<\/pre>\n<p><\/code><\/p>\n<h4>Dinamik \u0130\u00e7erik ve \u015eablonlar<\/h4>\n<p>Ger\u00e7ek d\u00fcnya uygulamalar\u0131nda, PDF'e d\u00f6n\u00fc\u015ft\u00fcrece\u011finiz HTML i\u00e7eri\u011fi genellikle dinamik verilerle olu\u015fturulur. Bu senaryoda, Handlebars, EJS veya Pug gibi bir \u015fablon motoru kullanmak olduk\u00e7a yayg\u0131nd\u0131r.<\/p>\n<p>\u00d6rnek olarak EJS kullanarak dinamik bir PDF olu\u015ftural\u0131m:<\/p>\n<p>1.  <strong>EJS Kurulumu:<\/strong><\/p>\n<pre><code class=\"language-bash\">npm install ejs<\/pre>\n<p><\/code><br \/>\n2.  <strong><code>template.ejs<\/code> dosyas\u0131:<\/strong><\/p>\n<pre><code class=\"language-html\"><!DOCTYPE html>\n    <html>\n    <head>\n        <title>Dinamik Rapor<\/title>\n        <style>\n            body { font-family: sans-serif; margin: 20mm; }\n            h1 { color: #2c3e50; }\n            table { width: 100%; border-collapse: collapse; margin-top: 20px; }\n            th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }\n            th { background-color: #f2f2f2; }\n        <\/style>\n    <\/head>\n    <body>\n        <h1>Rapor Tarihi: <%= reportDate %><\/h1>\n        <p>Merhaba <%= userName %>,<\/p>\n        <p>A\u015fa\u011f\u0131da talep etti\u011finiz rapor detaylar\u0131 bulunmaktad\u0131r:<\/p>\n\n        <table>\n            <thead>\n                <tr>\n                    <th>\u00dcr\u00fcn Ad\u0131<\/th>\n                    <th>Miktar<\/th>\n                    <th>Fiyat<\/th>\n                <\/tr>\n            <\/thead>\n            <tbody>\n                <% products.forEach(function(product){ %>\n                    <tr>\n                        <td><%= product.name %><\/td>\n                        <td><%= product.quantity %><\/td>\n                        <td><%= product.price %> TL<\/td>\n                    <\/tr>\n                <% }); %>\n            <\/tbody>\n        <\/table>\n\n        <p>Toplam \u00dcr\u00fcn Say\u0131s\u0131: <%= products.length %><\/p>\n    <\/body>\n    <\/html><\/pre>\n<p><\/code><br \/>\n3.  <strong>Node.js Kodu:<\/strong><\/p>\n<pre><code class=\"language-javascript\">const pdf = require('html-pdf');\n    const ejs = require('ejs');\n    const path = require('path');\n    const fs = require('fs');\n\n    const templatePath = path.join(__dirname, 'template.ejs');\n    const templateContent = fs.readFileSync(templatePath, 'utf8');\n\n    const data = {\n        reportDate: new Date().toLocaleDateString('tr-TR'),\n        userName: 'Ahmet Y\u0131lmaz',\n        products: [\n            { name: 'Laptop', quantity: 1, price: 12000 },\n            { name: 'Mouse', quantity: 2, price: 150 },\n            { name: 'Klavye', quantity: 1, price: 400 }\n        ]\n    };\n\n    ejs.render(templateContent, data, {}, (err, html) => {\n        if (err) return console.error('EJS render hatas\u0131:', err);\n\n        const options = { format: 'A4', orientation: 'portrait' };\n\n        pdf.create(html, options).toFile('.\/dynamic_report.pdf', function(err, res) {\n            if (err) return console.error('PDF olu\u015fturma hatas\u0131:', err);\n            console.log('Dinamik PDF ba\u015far\u0131yla olu\u015fturuldu:', res.filename);\n        });\n    });<\/pre>\n<p><\/code><br \/>\nBu \u00f6rnekte, EJS \u015fablon motorunu kullanarak <code>data<\/code> nesnesindeki bilgileri HTML'e enjekte ettik ve olu\u015fan dinamik HTML'i <code>html-pdf<\/code>'e ileterek PDF'e d\u00f6n\u00fc\u015ft\u00fcrd\u00fck.<\/p>\n<h3>html-pdf ile Geli\u015fmi\u015f Kullan\u0131m Senaryolar\u0131<\/h3>\n<p><code>html-pdf<\/code> k\u00fct\u00fcphanesi, temel kullan\u0131m\u0131n \u00f6tesinde, daha karma\u015f\u0131k senaryolar i\u00e7in de \u00e7e\u015fitli yetenekler sunar.<\/p>\n<h4>Harici Kaynaklar\u0131n Y\u00f6netimi (CSS, JS, Resimler)<\/h4>\n<p>HTML i\u00e7eri\u011finiz genellikle harici CSS dosyalar\u0131, JavaScript dosyalar\u0131 veya resimler i\u00e7erir. <code>wkhtmltopdf<\/code> bu kaynaklar\u0131 do\u011fru bir \u015fekilde y\u00fckleyebilmelidir.<\/p>\n<p>*   <strong>Mutlak Yollar:<\/strong> En g\u00fcvenli y\u00f6ntem, t\u00fcm harici kaynaklar i\u00e7in mutlak URL'ler kullanmakt\u0131r (\u00f6rne\u011fin, <code><link rel=\"stylesheet\" href=\"https:\/\/cdn.example.com\/style.css\"><\/code> veya <code><img decoding=\"async\" src=\"https:\/\/example.com\/images\/logo.png\"><\/code>).<br \/>\n*   <strong><code>base<\/code> Se\u00e7ene\u011fi:<\/strong> E\u011fer HTML i\u00e7eri\u011finizde g\u00f6receli yollar kullan\u0131yorsan\u0131z (\u00f6rne\u011fin, <code><img decoding=\"async\" src=\"\/images\/logo.png\"><\/code>), <code>options<\/code> nesnesindeki <code>base<\/code> se\u00e7ene\u011fini kullanarak bu g\u00f6receli yollar\u0131n \u00e7\u00f6z\u00fcmlenece\u011fi temel URL'yi belirtebilirsiniz:<\/p>\n<pre><code class=\"language-javascript\">const options = {\n        format: 'A4',\n        base: 'http:\/\/localhost:3000\/' \/\/ HTML'deki g\u00f6receli yollar bu URL'ye g\u00f6re \u00e7\u00f6z\u00fcmlenecek\n    };<\/pre>\n<p><\/code><br \/>\n    Bu, <code>wkhtmltopdf<\/code>'in HTML i\u00e7indeki <code>\/images\/logo.png<\/code> gibi bir yolu <code>http:\/\/localhost:3000\/images\/logo.png<\/code> olarak yorumlamas\u0131n\u0131 sa\u011flar.<br \/>\n*   <strong>Base64 Kodlama:<\/strong> K\u00fc\u00e7\u00fck resimler veya CSS dosyalar\u0131 i\u00e7in, i\u00e7eri\u011fi do\u011frudan HTML i\u00e7ine Base64 olarak kodlamak da bir y\u00f6ntemdir. Bu, harici ba\u011f\u0131ml\u0131l\u0131klar\u0131 ortadan kald\u0131r\u0131r ancak HTML dosyas\u0131n\u0131n boyutunu art\u0131r\u0131r.<\/p>\n<h4>Hata Y\u00f6netimi ve Performans \u0130pu\u00e7lar\u0131<\/h4>\n<p>*   <strong>Hata Y\u00f6netimi:<\/strong> <code>html-pdf.create().toFile()<\/code> veya <code>toStream()<\/code> metodlar\u0131n\u0131n callback fonksiyonundaki ilk arg\u00fcman her zaman bir hata nesnesidir (<code>err<\/code>). <code>wkhtmltopdf<\/code>'in bulunamamas\u0131, ge\u00e7ersiz HTML veya zaman a\u015f\u0131m\u0131 gibi durumlar bu <code>err<\/code> nesnesinde yakalanabilir.<\/p>\n<pre><code class=\"language-javascript\">pdf.create(html, options).toFile('.\/output.pdf', function(err, res) {\n        if (err) {\n            console.error('PDF olu\u015fturulurken bir hata olu\u015ftu:', err.message);\n            \/\/ Hata t\u00fcr\u00fcne g\u00f6re farkl\u0131 i\u015flemler yap\u0131labilir\n            if (err.message.includes('wkhtmltopdf binary not found')) {\n                console.error('L\u00fctfen wkhtmltopdf uygulamas\u0131n\u0131n kurulu oldu\u011fundan ve PATH\\'inizde bulundu\u011fundan emin olun.');\n            }\n            return;\n        }\n        console.log('PDF ba\u015far\u0131yla olu\u015fturuldu:', res.filename);\n    });<\/pre>\n<p><\/code><br \/>\n*   <strong>B\u00fcy\u00fck PDF'ler \u0130\u00e7in Stream Kullan\u0131m\u0131:<\/strong> \u00c7ok b\u00fcy\u00fck HTML i\u00e7eriklerini PDF'e d\u00f6n\u00fc\u015ft\u00fcr\u00fcrken, <code>toFile()<\/code> yerine <code>toStream()<\/code> metodunu kullanmak bellek kullan\u0131m\u0131n\u0131 optimize edebilir. Bu, PDF \u00e7\u0131kt\u0131s\u0131n\u0131 do\u011frudan bir yaz\u0131labilir ak\u0131\u015fa (writable stream) aktarman\u0131z\u0131 sa\u011flar.<\/p>\n<pre><code class=\"language-javascript\">const pdfStream = pdf.create(html, options).toStream(function(err, stream) {\n        if (err) return console.error(err);\n        stream.pipe(fs.createWriteStream('.\/large_output.pdf'));\n        console.log('B\u00fcy\u00fck PDF ak\u0131\u015f yoluyla olu\u015fturuluyor...');\n    });<\/pre>\n<p><\/code><br \/>\n*   <strong>Asenkron \u0130\u015flemler:<\/strong> PDF olu\u015fturma i\u015flemi zaman al\u0131c\u0131 olabilir. \u00d6zellikle bir web sunucusu ba\u011flam\u0131nda, bu i\u015flemleri bloklamayacak \u015fekilde asenkron olarak y\u00f6netmek \u00f6nemlidir. Promise tabanl\u0131 yakla\u015f\u0131mlar (<code>util.promisify<\/code> kullanarak) veya <code>async\/await<\/code> ile kodu daha okunabilir hale getirebilirsiniz.<\/p>\n<h4>Ba\u015fl\u0131klar ve Altbilgiler<\/h4>\n<p><code>wkhtmltopdf<\/code> ve dolay\u0131s\u0131yla <code>html-pdf<\/code>, PDF sayfalar\u0131na \u00f6zel ba\u015fl\u0131klar ve altbilgiler eklemek i\u00e7in g\u00fc\u00e7l\u00fc se\u00e7enekler sunar. <code>header<\/code> ve <code>footer<\/code> se\u00e7enekleri ile HTML i\u00e7eri\u011fi belirtebilir ve hatta sayfa numaralar\u0131 gibi dinamik bilgileri de ekleyebilirsiniz.<\/p>\n<pre><code class=\"language-javascript\">const options = {\n    format: 'A4',\n    header: {\n        height: '15mm',\n        contents: <code><div style=\"width: 100%; text-align: center; font-size: 10px; color: #555;\">\n                \u015eirket Raporu - ${new Date().getFullYear()}\n            <\/div><\/code>\n    },\n    footer: {\n        height: '15mm',\n        contents: {\n            default: <code><div style=\"width: 100%; text-align: right; font-size: 9px; color: #777;\">\n                    Sayfa <span style=\"font-weight: bold;\">{{page}}<\/span> \/ <span>{{pages}}<\/span>\n                <\/div><\/code>\n        }\n    }\n};<\/pre>\n<p><\/code><br \/>\n<code>{{page}}<\/code> ve <code>{{pages}}<\/code> gibi \u00f6zel yer tutucular <code>wkhtmltopdf<\/code> taraf\u0131ndan otomatik olarak g\u00fcncel sayfa numaras\u0131 ve toplam sayfa say\u0131s\u0131 ile de\u011fi\u015ftirilir.<\/p>\n<h3>Di\u011fer K\u00fct\u00fcphanelere K\u0131sa Bir Bak\u0131\u015f<\/h3>\n<p><code>html-pdf<\/code> k\u00fct\u00fcphanesi bir\u00e7ok senaryo i\u00e7in yeterli olsa da, bazen farkl\u0131 ihtiya\u00e7lar i\u00e7in alternatif \u00e7\u00f6z\u00fcmler d\u00fc\u015f\u00fcnmek gerekebilir.<\/p>\n<h4>node-html-to-image ve pdf-lib Kombinasyonu<\/h4>\n<p>Bu yakla\u015f\u0131m, HTML'i do\u011frudan PDF'e d\u00f6n\u00fc\u015ft\u00fcrmek yerine, \u00f6nce HTML i\u00e7eri\u011finin bir g\u00f6r\u00fcnt\u00fcs\u00fcn\u00fc (PNG veya JPEG) al\u0131r ve ard\u0131ndan bu g\u00f6r\u00fcnt\u00fcy\u00fc bir PDF belgesine ekler.<\/p>\n<p>*   <strong><code>node-html-to-image<\/code>:<\/strong> HTML'i bir taray\u0131c\u0131 motoru (genellikle Puppeteer'\u0131 dahili olarak kullan\u0131r, ancak harici bir servis olarak da yap\u0131land\u0131r\u0131labilir) arac\u0131l\u0131\u011f\u0131yla bir resme d\u00f6n\u00fc\u015ft\u00fcr\u00fcr. *Ancak, bu makalenin konusu \"Puppeteer olmadan\" oldu\u011fu i\u00e7in, bu k\u00fct\u00fcphane Puppeteer'\u0131 dahili olarak kulland\u0131\u011f\u0131 i\u00e7in do\u011frudan bir alternatif de\u011fildir. Ancak, Puppeteer'\u0131 ayr\u0131 bir servis olarak \u00e7al\u0131\u015ft\u0131r\u0131p sadece g\u00f6r\u00fcnt\u00fc alma API'sini kullanmak bir se\u00e7enek olabilir.*<br \/>\n*   <strong><code>pdf-lib<\/code>:<\/strong> Node.js ve taray\u0131c\u0131lar i\u00e7in s\u0131f\u0131rdan PDF olu\u015fturman\u0131z\u0131, d\u00fczenlemenizi ve var olan PDF'leri de\u011fi\u015ftirmenizi sa\u011flayan g\u00fc\u00e7l\u00fc bir k\u00fct\u00fcphanedir. Bir kez HTML'den bir g\u00f6r\u00fcnt\u00fc elde etti\u011finizde, <code>pdf-lib<\/code> kullanarak bu g\u00f6r\u00fcnt\u00fcy\u00fc kolayca bir PDF sayfas\u0131na yerle\u015ftirebilirsiniz.<\/p>\n<p><strong>Ne zaman mant\u0131kl\u0131 olur?<\/strong><br \/>\n*   Pixel-perfect bir \u00e7\u0131kt\u0131ya ihtiyac\u0131n\u0131z varsa ve HTML\/CSS'in <code>wkhtmltopdf<\/code> taraf\u0131ndan tam olarak render edilmeyece\u011finden endi\u015feleniyorsan\u0131z.<br \/>\n*   PDF \u00fczerinde daha fazla manip\u00fclasyon (\u00f6rne\u011fin, form alanlar\u0131 ekleme, metin ekleme) yapman\u0131z gerekiyorsa.<br \/>\n*   Ancak, metin se\u00e7ilemez veya kopyalanamaz hale gelir, bu da bir dezavantajd\u0131r.<\/p>\n<h4>Gotenberg (Docker Tabanl\u0131 API)<\/h4>\n<p>Gotenberg, HTML, Markdown, Office belgeleri ve daha fazlas\u0131n\u0131 PDF'e d\u00f6n\u00fc\u015ft\u00fcrmek i\u00e7in tasarlanm\u0131\u015f, Docker tabanl\u0131, ba\u011f\u0131ms\u0131z bir mikroservistir. Temelinde Chromium ve LibreOffice gibi ara\u00e7lar\u0131 kullan\u0131r, ancak bu ara\u00e7lar\u0131 kendi konteynerinde yal\u0131t\u0131lm\u0131\u015f bir \u015fekilde \u00e7al\u0131\u015ft\u0131r\u0131r.<\/p>\n<p>*   <strong>Avantajlar\u0131:<\/strong><br \/>\n    *   <strong>\u0130zolasyon:<\/strong> PDF d\u00f6n\u00fc\u015ft\u00fcrme i\u015flemini ana Node.js uygulaman\u0131zdan izole eder.<br \/>\n    *   <strong>\u00d6l\u00e7eklenebilirlik:<\/strong> Gotenberg servisinin birden \u00e7ok \u00f6rne\u011fini \u00e7al\u0131\u015ft\u0131rarak PDF d\u00f6n\u00fc\u015ft\u00fcrme y\u00fck\u00fcn\u00fc da\u011f\u0131tabilirsiniz.<br \/>\n    *   <strong>Kolay Kullan\u0131m:<\/strong> Node.js uygulaman\u0131zdan Gotenberg API'sine HTTP istekleri g\u00f6ndererek PDF olu\u015fturabilirsiniz, bu da karma\u015f\u0131k k\u00fct\u00fcphane ba\u011f\u0131ml\u0131l\u0131klar\u0131ndan kurtulman\u0131z\u0131 sa\u011flar.<br \/>\n*   <strong>Dezavantajlar\u0131:<\/strong><br \/>\n    *   Ek bir servis kurma ve y\u00f6netme maliyeti.<br \/>\n    *   Docker bilgisi gerektirir.<\/p>\n<p>Gotenberg, \u00f6zellikle y\u00fcksek hacimli ve kritik PDF d\u00f6n\u00fc\u015ft\u00fcrme ihtiya\u00e7lar\u0131 olan kurumsal uygulamalar i\u00e7in m\u00fckemmel bir se\u00e7enektir.<\/p>\n<h3>Sonu\u00e7<\/h3>\n<p>Node.js ile HTML'den PDF olu\u015fturma, modern web<\/p>\n","protected":false},"excerpt":{"rendered":"Bu, Node.js ile HTML&#8217;den olu\u015fturulmu\u015f basit bir PDF belgesidir.","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[136],"tags":[],"class_list":{"0":"post-40183","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-node-js","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Node.js ile HTML&#039;den PDF Olu\u015fturma (Puppeteer Olmadan) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Node.js ile HTML&#039;den PDF Olu\u015fturma (Puppeteer Olmadan)\" \/>\n<meta property=\"og:description\" content=\"Bu, Node.js ile HTML&#039;den olu\u015fturulmu\u015f basit bir PDF belgesidir.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-25T01:00:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/example.com\/images\/logo.png\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Node.js ile HTML&#8217;den PDF Olu\u015fturma (Puppeteer Olmadan)\",\"datePublished\":\"2026-02-25T01:00:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\"},\"wordCount\":2220,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"image\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/example.com\/images\/logo.png\",\"articleSection\":[\"Node.js\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#respond\"]}],\"copyrightYear\":\"2026\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\",\"name\":\"Node.js ile HTML'den PDF Olu\u015fturma (Puppeteer Olmadan) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/example.com\/images\/logo.png\",\"datePublished\":\"2026-02-25T01:00:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage\",\"url\":\"https:\/\/example.com\/images\/logo.png\",\"contentUrl\":\"https:\/\/example.com\/images\/logo.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Node.js ile HTML&#8217;den PDF Olu\u015fturma (Puppeteer Olmadan)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Node.js ile HTML'den PDF Olu\u015fturma (Puppeteer Olmadan) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/","og_locale":"tr_TR","og_type":"article","og_title":"Node.js ile HTML'den PDF Olu\u015fturma (Puppeteer Olmadan)","og_description":"Bu, Node.js ile HTML'den olu\u015fturulmu\u015f basit bir PDF belgesidir.","og_url":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2026-02-25T01:00:45+00:00","og_image":[{"url":"https:\/\/example.com\/images\/logo.png","type":"","width":"","height":""}],"author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"14 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Node.js ile HTML&#8217;den PDF Olu\u015fturma (Puppeteer Olmadan)","datePublished":"2026-02-25T01:00:45+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/"},"wordCount":2220,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"image":{"@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage"},"thumbnailUrl":"https:\/\/example.com\/images\/logo.png","articleSection":["Node.js"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#respond"]}],"copyrightYear":"2026","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/","url":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/","name":"Node.js ile HTML'den PDF Olu\u015fturma (Puppeteer Olmadan) - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage"},"image":{"@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage"},"thumbnailUrl":"https:\/\/example.com\/images\/logo.png","datePublished":"2026-02-25T01:00:45+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#primaryimage","url":"https:\/\/example.com\/images\/logo.png","contentUrl":"https:\/\/example.com\/images\/logo.png"},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/node-js-ile-htmlden-pdf-olusturma-puppeteer-olmadan\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Node.js ile HTML&#8217;den PDF Olu\u015fturma (Puppeteer Olmadan)"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/40183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=40183"}],"version-history":[{"count":0,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/40183\/revisions"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=40183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=40183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=40183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}