soffice convert html to pdf not working - openoffice.org

My code
soffice --headless -convert-to pdf:impress_pdf_Export 1.html
when I run this code command line it is not generating pdf file from the html
Please help...

Related

Aldec Active-HDL VSimSA Converting BDE files into VHDL files

I'm trying to automate compiling my Aldec block designs using the VSimSA shell instead of using the Aldec GUI. Currently, I am able to get the following command to work in the GUI console with the desired results (producing a converting a .bde file to a .vhd file in the compile directory as well as using the VHDL compiler on the .vhd file).
'''
acom -w -O3 -e 100 -work gen8_ieee -2008 -d <path to compile directory> -s <path to library.cfg> -j <path to projlib.cfg> <BDE file path>
'''
When issuing the same command in the VSimSA shell, I receive the following error. This error occurs for multiple lines in the bde file. If I run the same command in VSimSA on a .vhd file, it compiles with no issues.
*Error: COMP96_0010: <BDE file path> : (12, 36) : Invalid literal.*
Line 12 in the BDE file :
#DEFAULT_RANGE0="<range<index=\"0\"><name=\"bist_cctrl\"><left=\"bcw-1\"><direction=\"downto\"><right=\"0\"><initial_value=\"\"><delay=\"\">>"
Is there another command that needs to be issued first to convert the BDE file to a VHDL file prior to running the 'acom' command? The help documentation states the 'acom' command works with BDE files.

the make.sh for fastdht not work.When running it shows "nm: /usr/lib/libc_r.so:no such file"

I want to install fastdht. So I download source code from github
https://github.com/happyfish100/fastdht
I follow the INSTALL file, run make.sh first.
./make.sh
However, it shows the following error messages.
[root#localhost fastdht]# sh make.sh
make.sh: line 142: warning: here-document at line 2 delimited by end-of-file
(wanted `EOF')
make.sh: line 2: ./a.out: No such file or directory
nm: '/usr/lib/libc_r.so': No such file
nm: '/lib64/libc_r.so': No such file
nm: '/usr/lib64/libc_r.so': No such file
[root#localhost fastdht]#
What's the matter?
Maybe there are some format errors in make.sh.
I create a new file a.sh and type the contents of make.sh in it. When I run a.sh it works!

Synchronise pdf to Rnw in Knitr with texshop

Would anyone know how to get synctex to work from the pdf to the Rnw in knitr with texshop? It does work from Rnw to pdf. Many thanks.
This is how I worked this out. Not tried on multiple .Rnw files.
In TeXShop Preferences, make sure your "Sync Method" is set as "SyncTeX (TeX ≥ 2010)".
On your Mac, make the directory "~/Library/TeXShop/Rscripts" and put the R file "patchKnitrSynctex.R" downloaded from https://github.com/jan-glx/patchKnitrSynctex in this directory.
Create an executable file "Knitr.engine" including the following shell scripts and put it in "~/Library/TeXShop/Engines/":
#!/bin/bash
# export PATH=$PATH:/usr/texbin:/usr/local/bin # already on my path!
Rscript -e "library(knitr); knit('$1')"
latexmk -pdf -pdflatex='pdflatex -shell-escape -synctex=1 -file-line-error' "${1%.*}"
Rscript -e "source('~/Library/TeXShop/Rscripts/patchKnitrSynctex.R', echo=FALSE, encoding='UTF-8'); patchKnitrSynctex('${1%.*}')"
In R, install the package "patchDVI".
In your .Rnw file, add "% !TEX TS-program = Knitr" on the top line of the document. Also inside the .Rnw document somewhere around the top of the document add an R code chunk
<<setup, include=FALSE>>=
patchDVI::useknitr()
… #any other knitr global setups
#
Happy knitting!

wkhtmltopdf attempting to load from http rather than file

Here's an odd little problem that's led me to post my first question on SO. I am using wkhtmltopdf to convert an HTML document to a PDF as part of a Rails app. To do so, I am rendering the Rails web page to a static HTML file in a temp directory, copying a static header, footer and images to the same temp directory, then executing wkhtmltopdf using "system".
This works perfectly in Development and Test environments. In my Staging env, it does not. I suspected permissions at first, but the first couple of parts of that process (creating the HTML static files and copying them to the directory) are working. I can run wkhtmltopdf from the command line in that temp directory and get the expected outcome. Finally, I ran wkhtmltopdf via both "system" and backticks through the Rails console in staging environment, and here's what I get as output:
> `wkhtmltopdf --footer-html tmp/invoices/footer.html --header-html tmp/invoices/header.html -s Letter -L 0in -R 0in -T 0.5in -B 1in tmp/invoices/test.html tmp/invoices/this.pdf`
Loading pages (1/6)
QPainter::begin(): Returned false ] 10%
Error: Unable to write to destination
Error: Failed loading page http://tmp/invoices/test.html (sometimes it will work just to ignore this error with --load-error-handling ignore) => ""
Notice that last bit. I'm pointing to local files, but it's looking for them via http. OK, I think, maybe I need to be explicit and feed it the file:// protocol so it doesn't look for http. So I try this:
> system("wkhtmltopdf --footer-html file://Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/footer.html --header-html file://Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/header.html -s Letter -L 0in -R 0in -T 0.5in -B 1in file://Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/test.html file://Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/this.pdf")
Loading pages (1/6)
Error: Failed loading page file://library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/test.html (sometimes it will work just to ignore this error with --load-error-handling ignore)
=> false
Notice that this one fails with a lowercase "l" on Library. What the heck? (And no, it doesn't get any better with the recommendation to ignore the error with that switch.)
Any ideas? Is there a Rails or Ruby setting that would cause system commands to get rewritten? Is there an option I can add to wkhtmltopdf to make sure it loads from local file? I'm quite baffled. Thanks!
I have had success when using the absolute file path (notice the extra slash after the file://)
wkhtmltopdf --footer-html file:///Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/footer.html --header-html file:///Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/header.html -s Letter -L 0in -R 0in -T 0.5in -B 1in file:///Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/test.html file:///Library/Server/Web/Data/Sites/intranet-staging/current/tmp/invoices/this.pdf
This is the same on windows
Unix path
file:///absolute/path/to/file
Windows path
file:///C:/absolute/path/to/file
In last 0.11 whicked-pdf i found one bug
Example
C:\Ruby193\lib\ruby\gems\1.9.1\gems\wicked_pdf-0.11.0\lib>wicked_pdf.rb
Line 198 I change from:
options[hf][:html][:url] = "file://#{tf.path}" to options[hf][:html][:url] = "file:///#{tf.path}" - (change // to ///)
After change whicked-pdf again worked.
Take a look at the wicked_pdf gem.
You can add a PDF mime type and then whatever page you want pdf'd, just tack on a .pdf to the URL.
I am using this in prod and it works quite well.
No need to call wkhtmltopdf directly.

Markdown to PDF using Pandoc since Xetex Deprecation

On my MacBook (OSX Mountain Lion), I used to use this Pandoc command to convert Markdown to PDF:
$ markdown2pdf -N -o pandoc_output.pdf --xetex --toc --template=mytemplate.tex myfile.md
But markdown2pdf no longer works, and --xetex option in markdown2pdf -N -o ../../Desktop/pandoc_output.pdf --xetex --toc --template=mytemplate-headers-garamond_date.tex is deprecated.
If I do this:
$ pandoc -N -o Desktop/pandoc_output.pdf --xetex --toc --template=mytemplate.tex myfile.md
I get this:
pandoc: unrecognized option `--xetex'
But if I take out --xetex and do this:
$ pandoc -N -o Desktop/pandoc_output.pdf --toc --template=mytemplate.tex myfile.md
then I get this:
pandoc: Error producing PDF from TeX source.
! Package hyperref Error: Wrong driver option `xetex',
(hyperref) because XeTeX is not detected.
See the hyperref package documentation for explanation.
Type H <return> for immediate help.
...
l.3925 \ProcessKeyvalOptions{Hyp}
What's the solution?
Try --latex-engine=xelatex instead of --xetex
The prior answers to this question were helpful to me, as I had installed pandoc a couple years ago, but never Tex Live. Consequently I had no idea if I had installed it correctly, so putting in the entire path helped me to see that it was working, as follows:
pandoc --latex-engine=/usr/local/texlive/2012basic/bin/universal-darwin/xelatex
This is the default install location for the BasicTex setup which you download from the Pandoc install page.
I had also forgotten about using pandoc -D Latex >my-latex-template.tex to generate a template. After giving a .tex template instead of my .html one (which caused a 'you don't have BEGIN {' error) , I got .PDF: In other words, the default template worked.
Also, I had inaccurately entered -t pdf (not shown above) to set pdf as an output format, but this was not correct. The output format is Latex, which is then translated to PDF. It is not necessary to specify an output format with the dash -t option.
I hope this record of my minor stumbles saves someone some time.
See the pandoc User's Guide (or man page) for the --latex-engine option.

Resources