• Post Reply Bookmark Topic Watch Topic
  • New Topic

CSS FILE READING  RSS feed

 
ashu Suri
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U am converting epub file to a pdf. Epub file contains htmls and also css.
I want html file with all the formatting and fonts without using a separate css file.
Embedding the css tags is not what I want.
I want to replace the tags and classes used in html by actual style="" in the html file using java classes.
Please let me if anyone has any clue.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong with including the CSS file inside your HTML completely? So in you head, you would get a new style element with the contents of your CSS file:

This way, a) it's quite easy to do it, and b) you won't get style duplication if multiple HTML elements have the same class.
 
ashu Suri
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats right but the API i am using in Xalan and FOP which doesn't take css within style even in HTML.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably don't want to switch libraries, but https://xhtmlrenderer.dev.java.net/ can convert XHTML/CSS to PDF.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!