[Solved] java use OOo to convert PDF how to change page

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
ansj
Posts: 9
Joined: Sun Sep 26, 2010 9:47 am

[Solved] java use OOo to convert PDF how to change page

Post by ansj »

i can speak a little english !
i have a question ,i want to convert any type to pdf . bug it too big for me .
so i want get pdf 10 page ..hao can i set it ?
i use java
this is my convert code ..thanks !!!

Code: Select all


// Preparing properties for converting the document
		PropertyValue[] propertyValues = new PropertyValue[2];
		// Setting the flag for overwriting
		propertyValues[0] = new PropertyValue();
		propertyValues[0].Name = "Overwrite";
		propertyValues[0].Value = new Boolean(true);
		// Setting the filter name
		propertyValues[1] = new PropertyValue();
		propertyValues[1].Name = "FilterName";
		propertyValues[1].Value = convertType;

		// Composing the URL by replacing all backslashs
		File outputFile = new File(outputFilePath);
		String outputUrl = "file:///"
				+ outputFile.getAbsolutePath().replace('\\', '/');

		// Getting an object that will offer a simple way to store
		// a document to a URL.
		XStorable storable = UnoRuntime.queryInterface(XStorable.class, doc);
		// Storing and converting the document
		storable.storeToURL(outputUrl, propertyValues);
Last edited by Hagar Delest on Sun Sep 26, 2010 11:52 am, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.1
ansj
Posts: 9
Joined: Sun Sep 26, 2010 9:47 am

Re: java use oo to convert PDF how to change page

Post by ansj »

haha . i found method in this page :http://wiki.services.openoffice.org/wik ... properties
propertyValues[2] = new PropertyValue();
propertyValues[2].Name = "PageRange";
propertyValues[2].Value = "1-"+StaticValue.maxPage;

thanks
OpenOffice 3.1
Post Reply