473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OpenOffice UNO export PDF help needed

I've geen googling for 3 days now, and cannot find out how to do this.

I'm trying to use OpenOffice 2.0 and UNO to generate PDF documents. I'm
using windows, but will have to make it work under Linux for production.
I've been able to set the parameters and call the exportToPdf method, but
the exported file is not PDF but an .odt document, I can change suffix from
pdf to odt and double click on it and open it as openoffice. The project is
sort of a custom mail-merge, but there is little data used to produce a
lengthy contract and attachments. The whole thing needs to be done via a
cgi script or a servlet.

below is a java code snippet, submitted with apologies, I'm using that
rather than python because I found better examples and my java IDE helps me
out. I originally started out to do python, and will eventually shift back
to it once I get this working
public void writePDF(XTextD ocument doc, String stringUrl) {
String stringConvertTy pe ="PDF Creator";// args[ 1 ];
PropertyValue propertyvalueHi dden[] = new PropertyValue[ 0 ];
XStorable xstorable =( XStorable ) UnoRuntime.quer yInterface(
XStorable.class , doc );

// Preparing properties for converting the document
PropertyValue propertyvalue[] = new PropertyValue[ 2 ];
propertyvalue[ 0 ] = new PropertyValue() ;
propertyvalue[ 0 ].Name = "Overwrite" ;
propertyvalue[ 0 ].Value = new Boolean(true);
propertyvalue[ 1 ] = new PropertyValue() ;
propertyvalue[ 1 ].Name = "Filter";
propertyvalue[ 1 ].Value = "writer_pdf_Exp ort";
//propertyvalue[ 1 ].Value = "impress_pdf_Ex port"; //also tried
"PDF Creator"
xstorable.store ToURL( stringUrl+".pdf ", propertyvalue ); //also
tried storeAsUrl, same result

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------
Apr 30 '06 #1
1 2224
Sells, Fred wrote:
I've geen googling for 3 days now, and cannot find out how to do
this.

I'm trying to use OpenOffice 2.0 and UNO to generate PDF documents.
I'm using windows, but will have to make it work under Linux for
production. I've been able to set the parameters and call the
exportToPdf method, but the exported file is not PDF but an .odt
document,


Have you tried the ooextract.py found on:
http://udk.openoffice.org/python/python-bridge.html

Here work well and generate a pdf file.

See also this for more info about generate pdf:
http://mithrandr.moria.org/blog/447.html

Michele
May 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1366
by: Allenabethea | last post by:
Is there any advantage to upgrading the python distribution which is part of OpenOffice to 2.3.3? I notice it is version 2.2.2 Are the bug fixes crucial? allen
0
1576
by: Bob M | last post by:
This question is about MySQL and how it can be accessed with OpenOffice (presumably the same issue would arise with MS Office, but I'm not sure about that). The problem I'm having is with the setup in OpenOffice. The database currently consists of a single table, located in c:\MySQL\data. The database is CD_Collection; the table name is Album. There is no password associated with the database/table. (I'm just getting started, and wanted...
0
1972
by: Jean-Marie Gouarné | last post by:
The new OpenOffice::OODoc distribution, V 1.203, is available from CPAN today. It's an Expat-based Perl extension allowing direct read/write access to OpenOffice.org (XML) documents. It provides an object representation of the OOo documents, with a lot of methods to get, create, update or delete any content or presentation element, and attempts to hide the most part of the complex XPath navigation. This toobox is an XML API that deal...
205
10596
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
5
8539
by: Bob Powell | last post by:
Hello everyone: Can anyone tell me if it is possible to connect excel or openoffice via odbc directly to a postgres backend database. Also, if that is possible does either OpenOffice or Excel support SQL queries to said database? Bob Powell
0
2074
by: dtsearch | last post by:
New release expands-through a .NET Spider API, to Linux, and to OpenOffice-dtSearch's ability to index over a terabyte of text in a single index, with indexed search time typically less than a second BETHESDA, MD (January 10, 2006) dtSearch Corp., a leading supplier of enterprise and developer text retrieval software, announces Version 7.2 of its product line for instantly searching terabytes of documents across a desktop, network,...
4
1891
by: krishnakant Mane | last post by:
hello, right now I am involved on doing a very important accessibility work. as many people may or may not know that I am a visually handicap person and work a lot on accessibility. the main issue at hand is to create an accessible editor for open office. there are a lot of things remaining on that front. so right now I am trying to find out a temporary work around by creating a simple accessible editor (with wxpython) for viewing and...
7
2246
by: PaoloB | last post by:
Hi everyone, during our development, we need to write some unit tests that interact with OpenOffice through pyUno. Is there anyone who has got any experience on it? As OpenOffice is quite a large beast, and interaction is rather complex, I would like to know if there is someone who is willing to share experience (and, possibly, code).
0
2299
by: mahesh123 | last post by:
Hi Folks, How can i export the data from the MSFlexGrid to the MS Open Office Excel in VB 6.0? I Can Know how to export data from the MSFlexgrid to the MS Office Excel. Please Help me regarding this issuse. Advance Thanks & Regards ---------------------------------------- Mahesh
0
8438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.