Artigos‎ > ‎Ferramentas de Escritório‎ > ‎PDF‎ > ‎

Microsoft XPS on Ubuntu with mono

Como visualizar arquivos xps no ubuntu?

Para visualizar no ubuntu hardy, pode-se instalar o pacote OKULAR com o comando:
sudo apt-get install okular-kde4

PS: o Okular não permitiu a impressão do arquivo de teste.

Para converter para PDF utilize o Xps da Ndesk em Mono:
Link: http://www.ndesk.org/Xps

Download

The renderer uses the NDesk Cairo library, an updated version of Mono.Cairo:

git-clone git://git.ndesk.org/pub/scm/cairo-sharp

To get the (experimental) Xps sources:

git-clone git://git.ndesk.org/pub/scm/ndesk-xps

Usage

sudo apt-get install mono-1.0-devel mono-2.0-devel mono-mcs mono-gmcs
sudo apt-get install mono-gac mono-utils monodevelop monodoc-browser monodevelop-nunit monodevelop-versioncontrol
sudo apt-get install mono-xsp2 mono-xsp2-base asp.net2-examples
sudo apt-get install mono-xsp mono-xsp-base asp.net-examples
sudo cp /usr/share/asp.net2-demos/index.aspx /usr/share/asp.net2-demos/index2.aspx

cd ~/
svn co svn://anonsvn.mono-project.com/source/trunk/mono-addins mono-addins
cd mono-addins
./autogen.sh --prefix=/usr/
make
sudo make install
cd ~/

git-clone git://git.ndesk.org/pub/scm/cairo-sharp
git-clone git://git.ndesk.org/pub/scm/ndesk-xps
cd ~/cairo-sharp
make all
cp
~/cairo-sharp/src/NDesk.Cairo.dll ~/ndesk-xps/src
cd ~/ndesk-xps
make all
cd ~/ndesk-xps/src
mono loader.exe Document.xps

This produces Document.pdf.

PS: Não consegui fazer funcionar para o meu arquivo de teste até agora.
Erro abaixo se alguém puder ajudar:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream ICSharpCode.SharpZipLib.Zip.ZipEntry entry) [0x00000]
at NDesk.IO.Packaging.ZipPackagePart.GetStreamCore (FileMode mode, FileAccess access) [0x00000]
at NDesk.IO.Packaging.PackagePart.GetStream (FileMode mode) [0x00000]
at NDesk.IO.Packaging.PackagePart.GetStream () [0x00000]
at NDesk.Xps.Loader.Convert (NDesk.IO.Packaging.Package pkg, Int32 docnum, System.String outfname) [0x00000]
at NDesk.Xps.Loader.Main (System.String[] args) [0x00000]


Links para mono: http://www.debianadmin.com/running-aspnet-applications-in-debian-and-ubuntu-using-xsp-and-mono.html
Comments