Style Drupal's Print Module PDF - css

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.

Related

How to preview and print in PDF a markdown file with a file-specific CSS stylesheet in VS Code?

Here is my use case:
I want to create a markdown document (my CV for instance) and create a style for it using a CSS file. Then I want to print the PDF of my file.
I have installed the Markdown PDF extension in VS Code and it does its job.
To have the extension and the preview to properly render the styling, I changed the settings in vscode setting.json for both extensions to use my CSS file and it works.
For the preview:
{
"markdown.styles": ["my-styles.css"]
}
For the PDF export:
{
"markdown-pdf.styles": ["~/Documents/Styles/my-styles.css"]
}
However, this stylesheet is applied to all my markdown files and what I would like is to embed the CSS file for this specific file. I want to have a CV style for my CVs, a report style for reports, etc.
Is this feasible?
Using workspace specific settings solves my issue.
It does not allow to use one CSS per markdown file, but it's good enough: I can put all my CVs in one folder with the CV CSS in the workspace settings and my reports in another workspace with another CSS stylesheet

Can Javascript PptxGenJS library show preview before save?

I am using PptxGenJS library to create a pptx files with javascript. I want to preview of pptx before saving. How can I handle it?
I am afraid this is not possible. you need to get the created slides somehow into PowerPoint in order to view it, which requires a save and a load.
To really create a preview capability for slides, you would have to write a full slide rendering engine in JavaScript, which is obviously a huge effort.
Maybe your script can save files somewhere in a temporary place, and create simple macro in PowerPoint which enables some sort of preview, after which files can be saved with their final name and file path?

BigCommerce style editor not working after compiling LESS CSS files

I am adapting the Blueprint theme into a custom template for BigCommerce. I compiled the theme.less file with Crunch. The style editor loads correctly and displays all of my changes correctly. However, it does not process any changes made from within style editor; nor does it allow style editor to be published. It just "hangs."
I am uploading the four .less files:
style-editor-variables.less
internal-variables.less
init.less
theme.less
as well as the theme.css file, and the style.css file via webdav in Dreamweaver CC 2014. I have uploaded via Cyberduck, but have the same issue.
I have tried uploading the same six files without compiling them first, and most (but not all) of my changes are reflected in style editor, and style editor successfully reflects and saves changes made from within itself.
Are there any other files I need to upload (or not upload), or is there any special code I need to add in order to enable style editor to work?
Thanks for any input, advice, or guidance!

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

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