{"id":1460,"date":"2019-08-20T00:47:09","date_gmt":"2019-08-19T17:47:09","guid":{"rendered":"https:\/\/www.linuxid.net\/post\/?p=1460"},"modified":"2025-04-18T15:21:41","modified_gmt":"2025-04-18T08:21:41","slug":"convert-html-ke-pdf-dengan-htmldoc-di-debian-10","status":"publish","type":"post","link":"https:\/\/www.linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/","title":{"rendered":"Convert HTML ke PDF dengan HTMLDoc di Debian 10"},"content":{"rendered":"<p>HTMLDOC adalah program open-source yang dapat digunakan untuk mengonversi file sumber HTML dan Markdown ke file PostScript dan PDF.<\/p>\n<p>Ada dua jenis file HTML, 1) Dokumen terstruktur dengan pos seperti, H1, H2, dll yang dikenal sebagai <em>book<\/em> dan 2) dokumen tidak terstruktur tanpa pos yang dikenal sebagai halaman <em>text<\/em>.<\/p>\n<p>Dalam tutorial ini, kita akan menjelaskan cara menginstal HTMLDOC pada Debian 10 dan mengonversi file HTML ke pdf.<\/p>\n<h2>Persyaratan<\/h2>\n<ul>\n<li>Server yang menjalankan Debian 10.<\/li>\n<li>Masuk sebagai root atau user dengan hak sudo.<\/li>\n<\/ul>\n<h2>Update Sistem<\/h2>\n<p>Pertama, perbarui sistem Anda dengan versi terbaru dengan menjalankan perintah berikut:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt-get update &amp;&amp; apt-get upgrade -y<\/code><\/pre>\n<p>Setelah sistem Anda diperbarui, restart untuk menerapkan perubahan konfigurasi dan meminimalisir terjadinya error pada sistem.<\/p>\n<h2>Instal HTMLDOC<\/h2>\n<p>Secara default, HTMLDOC tersedia di repositori default Debian 10. Anda dapat menginstalnya dengan hanya menjalankan perintah berikut:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt-get install htmldoc -y<\/code><\/pre>\n<p>Setelah menginstal HTMLDOC, Anda dapat list semua opsi yang tersedia di HTMLDOC dengan perintah berikut:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">htmldoc --help<\/code><\/pre>\n<h2>Buat PDF Pertama Anda dari HTML<\/h2>\n<p>Pertama, buat file test.html dengan perintah berikut:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">nano test.html<\/code><\/pre>\n<p>kemudian tambahkan code html apapun atau dengan copy paste content berikut :<\/p>\n<pre>&lt;html&gt;&#13;\n&lt;head&gt;&#13;\n    &lt;title&gt;Testing Konversi PDF&lt;\/title&gt;&#13;\n&lt;\/head&gt;&#13;\n&lt;body&gt;&#13;\n    Ini adalah Body dari file testing PDF&#13;\n&lt;\/body&gt;&#13;\n&lt;\/html&gt;&#13;\n<\/pre>\n<p>Simpan dan tutup text editor setelah selesai.<\/p>\n<p>Sekarang, jalankan perintah berikut untuk mengonversi test.html ke test.pdf :<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">htmldoc --webpage -f test.pdf test.html<\/code><\/pre>\n<p>Perintah di atas akan menghasilkan file pdf baru bernama test.pdf.<\/p>\n<p>Selamat! Anda telah berhasil menginstal HTMLDOC di server Debian 10.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTMLDOC adalah program open-source yang dapat digunakan untuk mengonversi file sumber HTML dan Markdown ke&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1460","post","type-post","status-publish","format-standard","hentry","category-debian"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Convert HTML ke PDF dengan HTMLDoc di Debian 10 - Linuxid<\/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:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert HTML ke PDF dengan HTMLDoc di Debian 10 - Linuxid\" \/>\n<meta property=\"og:description\" content=\"HTMLDOC adalah program open-source yang dapat digunakan untuk mengonversi file sumber HTML dan Markdown ke&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/\" \/>\n<meta property=\"og:site_name\" content=\"Linuxid\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-19T17:47:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-18T08:21:41+00:00\" \/>\n<meta name=\"author\" content=\"xsand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Ditulis oleh\" \/>\n\t<meta name=\"twitter:data1\" content=\"xsand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/\",\"url\":\"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/\",\"name\":\"Convert HTML ke PDF dengan HTMLDoc di Debian 10 - Linuxid\",\"isPartOf\":{\"@id\":\"https:\/\/linuxid.net\/post\/#website\"},\"datePublished\":\"2019-08-19T17:47:09+00:00\",\"dateModified\":\"2025-04-18T08:21:41+00:00\",\"author\":{\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79\"},\"breadcrumb\":{\"@id\":\"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Beranda\",\"item\":\"https:\/\/linuxid.net\/post\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert HTML ke PDF dengan HTMLDoc di Debian 10\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/linuxid.net\/post\/#website\",\"url\":\"https:\/\/linuxid.net\/post\/\",\"name\":\"Linuxid\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/linuxid.net\/post\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79\",\"name\":\"xsand\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g\",\"caption\":\"xsand\"},\"url\":\"https:\/\/www.linuxid.net\/post\/author\/xsand\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Convert HTML ke PDF dengan HTMLDoc di Debian 10 - Linuxid","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:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/","og_locale":"id_ID","og_type":"article","og_title":"Convert HTML ke PDF dengan HTMLDoc di Debian 10 - Linuxid","og_description":"HTMLDOC adalah program open-source yang dapat digunakan untuk mengonversi file sumber HTML dan Markdown ke&hellip;","og_url":"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/","og_site_name":"Linuxid","article_published_time":"2019-08-19T17:47:09+00:00","article_modified_time":"2025-04-18T08:21:41+00:00","author":"xsand","twitter_card":"summary_large_image","twitter_misc":{"Ditulis oleh":"xsand","Estimasi waktu membaca":"1 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/","url":"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/","name":"Convert HTML ke PDF dengan HTMLDoc di Debian 10 - Linuxid","isPartOf":{"@id":"https:\/\/linuxid.net\/post\/#website"},"datePublished":"2019-08-19T17:47:09+00:00","dateModified":"2025-04-18T08:21:41+00:00","author":{"@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79"},"breadcrumb":{"@id":"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/linuxid.net\/post\/convert-html-ke-pdf-dengan-htmldoc-di-debian-10\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Beranda","item":"https:\/\/linuxid.net\/post\/"},{"@type":"ListItem","position":2,"name":"Convert HTML ke PDF dengan HTMLDoc di Debian 10"}]},{"@type":"WebSite","@id":"https:\/\/linuxid.net\/post\/#website","url":"https:\/\/linuxid.net\/post\/","name":"Linuxid","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxid.net\/post\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":"Person","@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79","name":"xsand","image":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g","caption":"xsand"},"url":"https:\/\/www.linuxid.net\/post\/author\/xsand\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/comments?post=1460"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1460\/revisions"}],"predecessor-version":[{"id":2855,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1460\/revisions\/2855"}],"wp:attachment":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/media?parent=1460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/categories?post=1460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/tags?post=1460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}