{"id":42,"date":"2025-02-23T20:42:29","date_gmt":"2025-02-23T20:42:29","guid":{"rendered":"https:\/\/docs.marisabel.nl\/?p=42"},"modified":"2025-02-23T20:42:29","modified_gmt":"2025-02-23T20:42:29","slug":"remove-stylesheet-css-from-epub-files-with-linux","status":"publish","type":"post","link":"https:\/\/docs.marisabel.nl\/?p=42","title":{"rendered":"Remove stylesheet.css from epub files with Linux"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Problem:<\/h2>\n\n\n\n<p>I cannot use my own font when an open\/not-DRM .epub has it&#8217;s own stylesheet being forced.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>I have not tested this in DRM epubs. Though most modern ones will not have the <code>stylesheet.css<\/code> forced. So it should be fine.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Solution:<\/h2>\n\n\n\n<p>Remove the file using a zip application without extracting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Script:<\/h2>\n\n\n\n<p>Move books to your Linux machine.<\/p>\n\n\n\n<p>Install Zip: <code>sudo pacman -S zip<\/code><\/p>\n\n\n\n<p>Save this script as: <code>remove_styles.sh<\/code> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\nfor epub in *.epub; do\n    echo \"Processing: $epub\"\n    zip -d \"$epub\" \"*stylesheet.css\"\ndone<\/code><\/pre>\n\n\n\n<p>Change permissions: <code>chmod +x remove_styles.sh<\/code><\/p>\n\n\n\n<p>Run: <code>.\/remove_styles.sh<\/code><\/p>\n\n\n\n<p>Copy books again to your device.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: I cannot use my own font when an open\/not-DRM .epub has it&#8217;s own stylesheet being forced. I have not tested this in DRM epubs. Though most modern ones will not have the stylesheet.css forced. So it should be fine. Solution: Remove the file using a zip application without extracting. Script: Move books to your Linux machine. Install Zip: sudo pacman -S zip Save this script as: remove_styles.sh Change permissions: chmod +x remove_styles.sh Run: .\/remove_styles.sh Copy books again to your device.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,18],"tags":[30,19,31,29],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-linux","category-tutorials","tag-fonts","tag-kobo","tag-linux","tag-script","entry"],"_links":{"self":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":1,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}