Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 07-06-2021, 05:43 PM   #31
lxs602
Junior Member
lxs602 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2021
Device: none
PrincePDF and styles.css on Linux

Hi,

I am trying to use the PrincePDF plugin on Sigil 1.6.0 on Linux.

I added
Code:
 "style": true,
to /home/user/.local/share/sigil-book/sigil/plugins_prefs/PrincePDF/PrincePDF.json to enable a custom stylesheet, style.css.

I put a custom style.css in the following directories, but the plugin does not find it (The epub file is in /home/user):

Quote:
/home/user/.local/share/sigil-book/sigil/plugins_prefs/PrincePDF/PrincePDF.json
/home/user/.local/share/sigil-book/sigil/plugins/PrincePDF
/home/user/.local/share/sigil-book/sigil/
/home/user
I get the error:
Code:
prince: Applying style sheets...
prince: loading style sheet: ../style.css
prince: ../style.css: warning: can't open input file: No such file or directory

The below is just a guess as I cannot code (it did not work), but I also tried temporarily changing the line in plugin.py , from:
Code:
stylesheet_path = os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'style.css')
to:
Code:
stylesheet_path = os.path.join('/home/user', 'style.css')
Where should I put the styles.css file?

Thanks,

L

Last edited by lxs602; 07-06-2021 at 05:47 PM.
lxs602 is offline   Reply With Quote
Old 07-06-2021, 06:44 PM   #32
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by lxs602 View Post
Hi,

I am trying to use the PrincePDF plugin on Sigil 1.6.0 on Linux.

I added
Code:
 "style": true,
to /home/user/.local/share/sigil-book/sigil/plugins_prefs/PrincePDF/PrincePDF.json to enable a custom stylesheet, style.css.

I put a custom style.css in the following directories, but the plugin does not find it (The epub file is in /home/user):



I get the error:
Code:
prince: Applying style sheets...
prince: loading style sheet: ../style.css
prince: ../style.css: warning: can't open input file: No such file or directory

The below is just a guess as I cannot code (it did not work), but I also tried temporarily changing the line in plugin.py , from:
Code:
stylesheet_path = os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'style.css')
to:
Code:
stylesheet_path = os.path.join('/home/user', 'style.css')
Where should I put the styles.css file?

Thanks,

L
The 'style.css' file goes in the plugin folder. The second one in the list of folders you tried.

Code:
/home/user/.local/share/sigil-book/sigil/plugins/PrincePDF
Obviously "user" needs to be changed to your actual user name. It works as described for me. But I'm worried about your output:

Code:
prince: loading style sheet: ../style.css
Is that the actual output you're seeing? Because when I run the plugin, it shows the entire path to the style.css file:

Code:
prince: loading style sheet: /home/<USER>/.local/share/sigil-ebook/sigil/plugins/PrincePDF/style.css
DiapDealer is offline   Reply With Quote
Old 07-07-2021, 03:26 PM   #33
lxs602
Junior Member
lxs602 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2021
Device: none
Hi,

That was the actual output: https://imgur.com/a/BxMx613



I just ran Sigil from terminal, and I noticed:
Quote:
Debug: URLSchemeHandler failed request for: QUrl("sigil:///tmp/Sigil-WLAXFL/OEBPS/style.css")
I copied style.css to the /tmp/Sigil-WLAXFL/OEBPS/style.css and it worked.

Also, I can now see that I was incorrectly using "styles.css", rather than style.css.
lxs602 is offline   Reply With Quote
Old 07-07-2021, 04:37 PM   #34
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You don't want to be copying stuff to Sigil's scratch (temp) directory. Bad things can happen. But then the plugin's code doesn't indicate it would be looking for the custom style.css file in that location in the first place.

Did you make sure to run Sigil's Tools > Restructure Epub to Sigil Norm before running the PrincePDF plugin? It sounds to me that there are some pathing issues you're running into.

As per the plugin's notes from the first page:
Quote:
This plugin does not support non-standard epubs. Select Tools > Restructure Epub to Sigil Norm before running this plugin with Sigil 1.0 and higher.
DiapDealer is offline   Reply With Quote
Old 05-03-2023, 03:53 PM   #35
Wajsar Josef
Junior Member
Wajsar Josef began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2023
Device: none
Hi, this plugin is very awesome.
But, can I use javascript in this?

I try:
{
"javascript": true,
"style": true,
...
}

But it not working.
Thank you very much.
Wajsar Josef is offline   Reply With Quote
Old 05-03-2023, 05:40 PM   #36
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Wajsar Josef View Post
Hi, this plugin is very awesome.
But, can I use javascript in this?
The plugin is only looking for the following settings:
Code:
  "prince_path": "",
  "output_dir": "",
  "page_size": "",
  "page_margin": "",
  "cpdf": false
(All other values will be ignored.)
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF Export fails KRead123 Calibre 2 05-19-2016 05:56 AM
pdf metadata export devils_add Library Management 4 05-09-2014 02:46 AM
Request Batch export annotated pdf gotmilt enTourage eDGe 2 11-18-2011 04:57 PM
pdf import/export and notes nettomb Sony Reader 0 04-03-2011 08:42 PM
PRS-650 Export pdf with highlights? zoobiliezoo Sony Reader 0 10-28-2010 01:11 AM


All times are GMT -4. The time now is 12:09 PM.


MobileRead.com is a privately owned, operated and funded community.