Linking css file inside to xslt file - css

I'm using Apache FOP library to make a transform from a html + css file to pdf file. To do this process, I use several API's to reach to the final pdf. Firstly, I convert the html file to xml using TagSoup, then I transform xml to xsl-fo using xslt stylesheet for then and last step, I transform the xls-fo generated to pdf file. My problem comes when I view the pdf. I want to apply the same css styles as I apply in the html to the pdf too. I know if there are any way to link or include the css files in the xslt file when I try to do the transform to apply this styles on the final pdf.
I know this question is more theorical than a concrete practical case.
I hope anyone can help me.
Thanks!

Related

How to apply a stylesheet or theme to orgmode pdf export

Asciidoctor mades it very easy to apply a theme or stylesheet to a pdf for export. There is an entire github repo of high quality stylesheets that you can apply to PDF exports.
Now I use Emacs orgmode for so much of my work, I wanted to be able to similarly apply a stylesheet to the pdf output. My question is, how can someone apply a stylesheet when publishing an org file to PDF? I know that beamer has themes that you can apply to slides, and that generates PDF output. However I was looking for the same functionality to write notes and documents.
I looked at the following tutorial on org-publish. The tutorial is actually about exporting to html. But the key insight is that you can apply a setting like:
# Local Variables:
# org-export-html-style: "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/stylesheet.css\" />"
# End:
to the org file header, and it should apply this info to the output. HOWEVER, this solution makes sense in the context of HTML but not necessarily PDF. With HTML you just have to make the stylesheet accessible to the HTML file through the reference and don't need to actually change the HTML, etc. The browser takes care of the rest. But with a PDF it is not so simple--especially since org seems to export to PDF through Latex.
So I went back and checked on Asciidoctor to see how it was about to apply stylesheets to Asciidoc output. Turns out that Asciidoctor does not generate Latex code, but instead exports to PDF using the Ruby Prawn generator. So that explains a key difference between the orgmode pipeline and the Asciidoctor pipeline.
So again, my question was how to apply a stylesheet to an org file when exporting to pdf.
Thanks for any help.
Org-mode exports to LaTeX and then converts the LaTeX to PDF. see here This suggests that the styling of a PDF should use LaTeX classes. That implies semantic markup rather than graphic markup.
To me, it looks like the obvious way to use CSS for a PDF is to export to HTML and then convert the HTML to PDF. The long term approach is probably to learn LaTeX since this is the way org-mode is currently designed to work.

Umbraco: Output contents of SVG file from media library

I have an SVG uploaded through the media library.
I want to be able to style the paths in the SVG using CSS, so rather than displaying it in an image tag, I need to output the XML within the file to the template.
Any ideas?
Umbraco 7.3.0
Found a solution that works for me, but it may be messy
#Html.Raw(System.IO.File.ReadAllText(Server.MapPath(Umbraco.TypedMedia(globalSettings.GetProperty("websiteLogo").Value).Url)))

overriding styles defined on production server for DITA XML files

Here is scenario I am working in.
Using Eclipse with IXIASoft DITA CMS and Oxygen XML editor.
Retrieve files stored in DITA CMS and edit in oxygen.
Generate pdf output. PDF creation is controlled by antennae house libraries on a production server and I do not have access to xsl stylesheets or css files on production server.
I tried embedding styles in dita file, but it appears that files on production server override whatever I do. Tried linking to local css file, but it too seems to be overridden.
Also limited by what is allowed in the custom DTD. Did find an outputclass attribute for the p element, but not sure how to use it. Any suggestions.
The PDF output generated via the DITA Open Toolkit (used also by Ixiasoft) is not related in any way to CSS styling. The DITA content gets translated to an XSL-FO format which then gets processed to PDF using a PDF processor like the default Apache FOP.
So you need access to the XSLT code on the server side in order to provide any PDF customization.
Usually a PDF customization without directly modifying the XSLT code from the DITA OT is done like this:
http://www.oxygenxml.com/doc/ug-oxygen/#topics/dita_pdf_output_customization.html
Regards,
Radu
If you cannot add a plugin to the DITA-OT image on the server, you're actually out of luck for changing the PDF output. If, however, you can create a plugin for the DITA-OT image used by Ixiasoft, and can run the ant integrator on that image, then you should be able to change those styles.
Keep in mind that overriding PDF is not for the faint of heart and if you have no experience with XSLT and XSL-FO, I suggest you get a consultant to help you.
Julio J. Vazquez
Write Spirit

Style Drupal's Print Module PDF

How would one do this in Drupal 7? I want to add a few small style edits to the way the PDF outputs. I am using TCPDF. I read somewhere that its not posible with TCPDF, but other sources say it is. Should I be switching to dompdf? I've read the documentation but just can't seem to understand which file generates the PDF.
I have the module successfully generating a PDF from a View, so this is the last step in moving on with this project.
For anytime you want to style PDFs use DOMPDF, it will be less painful. Then style your pdf using print.css in the sites/domain.com/themes/yourtheme/css folder.
You can also copy the print.tpl.php file from the module's folder and paste it in sites/domain.com/themes/yourtheme/templates to choose exactly what you want to display in your pdf.

How to apply CSS to created pdf file in ASP.NET

I have generated a pdf file using third party now I want apply my own style to the content in pdf.
Can I insert an External CSS File into a generate PDF.
I have tried many ways but all is not working.
Thanks,
You cannot style an already generated PDF with CSS. It is not made out of selectable elements and there is no way to link the CSS to the PDF.
You will have to do the styling before the PDF is created. It's like trying to add more sugar to an already baked cake, there is no way to do it.

Resources