Weasyprint printing corrupt pdfs - css

I am trying to create a pdf using WeasyPrint on windows 10. It corrupts the css in the generated pdf, as shown in the image below. It is also not able to render images correctly and doesnt open in adobe acrobat with the error: "There was a problem reading this document (135)." (When did the same setup in mac OS a while ago, I did not face these issues)
I have tried changing the cairo version but that doesnt help. Any ideas on possible reasons why the css is messed up would be helpful.

Related

How can I insert pdf images in Rmarkdown on Windows system?

The most common way to insert a pdf image in an rmarkdown file is to use:
knitr::include_graphics("image.pdf")
or
![](image.pdf)
However, this does not work on a Windows OS. If you run this on a Windows OS, it will show
This picture can't be displayed
for docx outputs and
Couldn't load plugin
for html outputs. Is there a way to work around this?

UTFT_SdRaw not loading image properly

I'm trying to load multiple images with the UTFT_SDRaw library. I had some .raw files from the internet and they worked nicely. Now I made an image in png and converted it to Raw with a program called:
"Fiji ImageJ". After converting I moved it to my 4gb 32Fat sdcard. Changed the code a bit and the old images still loaded but my image is like a rainbow dotted square. I assume the file type isn't right although it's .raw. I can't find any specifications on the working images or what so ever and can't find anything on google.
Does someone have a program that can be used to convert my pngs to raw properly?
Or is there something else i did wrong?

Winnovative - PDF generated as image instead of text

I am using winnovative tool to generate PDF.
My problem is PDF which is getting generated is Image not as text.
This issue exists in all browser (Mozila, Chrome and IE)
Is there any fix for this?
Regards,
Sagar
You are using a very old version of the software. The current version you can download from http://www.winnovative-software.com/download.aspx should work very well.

Print a file from Watir

I'm looking at Watir-Webdriver to manipulate a browser. In particular, I'd like to open a local file and print it to a PDF file.
Yes, wkhtmltopdf would be a good thing, but it's not working for me on debian squeeze, for reasons that are difficult to ascertain. The page contains Javascript, which rules out many html-to-pdf options. wkhtmltopdf works on OS X, same version (0.9.9), so I know it's not a problem with how I'm using it (PDFKit and Ruby). I'd just like to sidestep these issues and try a different way. Opening up chromium on debian shows a perfectly rendered page.
How does one "print" from Watir?
Edit: After more reading, I think there is no way to do this.
You could take a png sreenshot, then use the prawn gem to convert the png screenshot to a pdf:
require 'prawn'
require 'watir-webdriver'
b = Watir::Browser.start 'watirwebdriver.com'
b.driver.save_screenshot 'screenshot.png'
Prawn::Document.generate 'screenshot.pdf' do
image 'screenshot.png', :scale => 0.5
end
b.close
You'll need to use something that lets you do automation at the OS level. such as Autoit or maybe RAutomation. not sure what exists to do this on *nix operating systems.
Watir only drives the browser in terms of what is inside the browser window, it has very limited capability to work the menus of the browser itself.

Highcharts running off local directory

I am working with a js library named Highcharts and it is only working some of the time.
In all cases the links to the library are relative and I have proven that the code is not at faUlt (at least, not the code I have written). I am also loading a seperate library which works fine on all platforms.
If I load the page in IE the address is:
C:\path\to\file
If I upload it, then:
http://www.foo-bar.com/path/to/file
These both work.
However, if I open it locally in FF or Chrome, then the path is:
file:///C:/path/to/file
This last one doesn't work. Does anyone know why this might be?
Thanks in advance.
The problem here was Access-Control-Allow-Origin. My solution was to load the data as inline jSON, rather than link to a csv with the data in it.

Resources