# wkhtmltopdf



## igor_l (Jul 7, 2012)

Hello , *I* copiled wkhtmltopdf on freebsd server but when *I* try to convert html in pdf *I* get the error 

```
[root@ /bin]# pwd
/bin
[root@ /bin]# ./wkhtmltopdf google.ru 1.pdf
wkhtmltopdf: cannot connect to X server
```
in the following sequence *I* compiled converter

1 step.
`# git clone [url=git://gitorious.org/+wkhtml2pdf/qt/wkhtmltopdf-qt.git]git://gitorious.org/+wkhtml2pdf/qt/wkhtmltopdf-qt.git[/url] wkhtmltopdf-qt`

2 step.

```
./configure -prefix /disk2/wkqt -release -static -fast -exceptions -no-accessibility -no-stl -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-qt3support -xmlpatterns -no-phonon -no-phonon-backend -webkit -no-scripttools -no-mmx -no-3dnow -no-sse -no-sse2 -system-zlib -graphicssystem raster -opensource -confirm-license -nomake tools -nomake examples -nomake demos -nomake docs -nomake translations -no-opengl -no-dbus -no-multimedia -openssl -no-declarative -largefile -rpath -no-nis -no-cups -no-iconv -no-pch -no-gtkstyle -no-nas-sound -no-sm -no-xshape -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-mitshm -no-xinput -no-xkb -no-glib -no-openvg -no-opengl -no-xsync -no-audio-backend -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -system-libtiff -system-libpng -system-libmng -system-libjpeg "$@"
```

3 step.

```
gmake 
gmake install
```
4 step.

```
cd wkhtmltopdf-0.11.0_rc1
/disk2/wkqt/bin/qmake
gmake
gmake install
```

5 step.

```
cd /bin
[root@ /bin]# ./wkhtmltopdf ya.ru 1.pdf
wkhtmltopdf: cannot connect to X server
```
Please help me.  I need a static binary of wkhtmltopdf , I read the old issues and find information about the patches, where can I get these patches and how to build the converter

thanks for all help.

FreeBSD 8.2


----------



## jb_fvwm2 (Jul 8, 2012)

```
portmaster -PP  converters/wkhtmltopdf
```
Is what you have tried anything like that ?


----------



## igor_l (Jul 8, 2012)

I need the manual assembly!!!


----------



## SirDice (Jul 9, 2012)

Don't run it as root.


----------



## wblock@ (Jul 9, 2012)

SirDice said:
			
		

> Don't run it as root.



Or set $DISPLAY so that root can run graphic programs.  But there are a lot of unanswered questions that ought to be considered first: why a static binary?  Why is X on a server?  Why that program?


----------

