Buy Now

novaPDF Professional
$62.44 $49.95

novaPDF Standard
$53.27 $39.95

novaPDF Lite
$24.94 $19.95

Awards & Reviews

  • 1_ico
  • 2_ico
  • 3_ico
  • 4_ico

Lockergnome feature

novaPDF is really neat

"novaPDF – Print To PDF Without Breaking The Bank. After downloading and installing the program (which takes all of one minute) you’re ready to print to a PDF. Any program that can print via the standard Windows printer interface can print to PDF (i.e. convert a file to PDF), including text, Word, Excel, […] , novaPDF will convert your files into PDF format without making your wallet cry."

Editor’s Review

This application is great

"[...] Pluses: novaPDF supports multiple profiles. This means that all your settings can be easily saved or loaded. Another great feature is the program’s ability to put bookmarks into the PDF document it creates. Drawbacks/flaws: [none] In conclusion: This application is great for generating PDF documents out of any type of printable data."

Indezine Review

Provides a good balance

"[...] novaPDF provides a good balance between price and performance -- it's a very usable option between free and highly priced PDF creators so that you can provide PDF output capabilities to a large number of users at a reasonable cost."

AC Review

Extremely easy to use

"[...]I highly recommend NovaPDF as a great and very simple way to create standard PDF documents that are fully compatible with Adobe Acrobat Reader. Nova PDF creator is an extremely easy to use and simple PDF creator"

Latest News

November 24, 2009

novaPDF 7 was released.

Changes in version 7:
  • Added option to digitally sign PDF files
  • Type1 fonts are now supported
  • novaPDF now includes add-ins for Microsoft Office (Word and Excel)
  • Added a start page to allow quick access to create PDFs
  • Fully compatible with Windows 7

You can download version 7 here: Download novaPDF 7

Stay Updated

To join, simply enter your email address below and click on Subscribe.

About Us

Softland, the company that develops novaPDF, achieved the Microsoft Certified Partner status with an ISV/Software Solutions Competency. Microsoft Certified Partner
Add comment
Votes: 0
Comments: 0
Note: To be able to use the samples you must install novaPDF SDK as samples work only with it. Download it here: nova PDF SDK.

The Word OLE (Java) SDK sample is a basic Java console application that converts a MS Word document (in this sample the default location for the source document is C:\temp\test.doc) to PDF using Word OLE automation and j-Interop.

“j-Interop is a Java Open Source library (under LGPL) that implements the DCOM wire protocol (MSRPC) to enable development of Pure, Bi-Directional, Non-Native Java applications which can interoperate with any COM component.“ j-Interop can be found at http://www.j-interop.org/

Note
If you encounter problems or have questions on using j-Interop, visit their FAQ page. Also, to avoid the “Logon failure: unknown user name or bad password” error, configure DCOM for remote access (detailed here) and make sure your firewall is not turned on.

Source code for Word OLE sample (Main.java):
package wordole;
/*
* j-interop can be found at http://www.j-interop.org/
* and it is an open source project
*
*/

import java.io.File;
import java.util.logging.Level;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.common.JISystem;
import org.jinterop.dcom.core.IJIComObject;
import org.jinterop.dcom.core.JIComServer;
import org.jinterop.dcom.core.JIProgId;
import org.jinterop.dcom.core.JISession;
import org.jinterop.dcom.core.JIString;
import org.jinterop.dcom.core.JIVariant;
import org.jinterop.dcom.impls.JIObjectFactory;
import org.jinterop.dcom.impls.automation.IJIDispatch;

public class Main {

public static String PROFILE_NAME = "Test Java and Word OLE";
public static int PROFILE_IS_PUBLIC = 0;

/**
* @param args the command line arguments
*/

public static void main(String[] args) {

if (args.length < 4) {
System.out.println("Please provide address domain username password");
return;
}
File docFile = new File("c:\\temp\\test.doc");
if (!docFile.exists()) {
System.out.println("c:\\temp\\test.doc file does not exist");
return;
}

//disable J-Interop Log
try {
JISystem.getLogger().setLevel(Level.INFO);
JISystem.setInBuiltLogHandler(false);
} catch (Exception e) {
//System.out.println(e.getMessage());
}

JIComServer comStub = null;
IJIDispatch dispatch = null;
IJIComObject unknown = null;

try {
JISession session = JISession.createSession(args[1], args[2], args[3]);
session.useSessionSecurity(true);

JIProgId pid = JIProgId.valueOf("novapi.NovaPdfOptions");
pid.setAutoRegistration(true);

comStub = new JIComServer(pid, args[0], session);
unknown = comStub.createInstance();

dispatch = (IJIDispatch) JIObjectFactory.narrowObject(unknown.queryInterface
(
IJIDispatch.IID));

JIString PRINTER = new JIString("<%novaPDF printer%>");
JIString UNAME = new JIString("");
JIString UKEY = new JIString("");
JIString UAPP = new JIString("");
JIString APPNID = new JIString("Word.Application");
dispatch.callMethod("Initialize2", new Object[]{PRINTER, UNAME, UKEY, UAPP});


JIVariant ap[] = dispatch.callMethodA("GetActiveProfile2", new Object[]{new
JIVariant("", true), new JIVariant(0, true)});

String activeProfile = ap[2].getObjectAsString().getString();
int nActivePublic = ap[1].getObjectAsInt();

try {
dispatch.callMethod("CopyProfile2", new Object[]{new
JIString(activeProfile), new JIString(PROFILE_NAME), PROFILE_IS_PUBLIC});

} catch (JIException come) {
System.out.println("CopyProfile2:" + come.getMessage());
}

try {
// set the copy profile as active profile ...
dispatch.callMethod("SetActiveProfile2", new Object[]{new
JIString(PROFILE_NAME), PROFILE_IS_PUBLIC});
} catch (JIException come) {
System.out.println("SetActiveProfile2:" + come.getMessage());
}

try {
// and set some options
dispatch.callMethod("SetOptionString2", new Object[]{new
JIString("Document Subject"), new JIString("Java Word OLE document"), new
JIString(PROFILE_NAME), PROFILE_IS_PUBLIC});
dispatch.callMethod("SetOptionString2", new Object[]{new
JIString("Save File"), new JIString("novaPDFJavaDocument"),
new JIString(PROFILE_NAME), PROFILE_IS_PUBLIC});
dispatch.callMethod("SetOptionString2", new Object[]{new
JIString("File Conflict Strategy"), new JIString("3"), new
JIString(PROFILE_NAME), PROFILE_IS_PUBLIC});
dispatch.callMethod("SetOptionString2", new Object[]{new
JIString("Post Save Open"), new JIString("1"), new JIString(PROFILE_NAME),
PROFILE_IS_PUBLIC});
dispatch.callMethod("SetOptionString2", new Object[]{new
JIString("Prompt Save Dialog"), new JIString("0"), new JIString(PROFILE_NAME),
PROFILE_IS_PUBLIC});
} catch (JIException come) {
System.out.println(come.getMessage());
}
//InitializeOLEUsage("Word.Application");
dispatch.callMethod("InitializeOLEUsage", new Object[]{APPNID});
dispatch.callMethod("LicenseOLEServer");

MSWord word = new MSWord(args[0], args, dispatch, PRINTER);
word.startWord();
word.showWord();

word.performOp();


word.quitAndDestroy();

try {
dispatch.callMethod("SetActiveProfile2", new Object[]{new
JIString(activeProfile), nActivePublic});
} catch (JIException come) {
System.out.println("SetActiveProfile2" + come.getMessage());
}
try {
dispatch.callMethod("DeleteProfile2", new Object[]{new
JIString(PROFILE_NAME), PROFILE_IS_PUBLIC});
} catch (JIException come) {
System.out.println("DeleteProfile2:" + come.getMessage());
}
System.out.println("Done!");

} catch (Exception e) {
System.out.println("---UPS---");
e.printStackTrace();
}
}
}

Source code for Word OLE sample (MSWord.java):
package wordole;
/*
* j-interop can be found at http://www.j-interop.org/
* and it is an open source project
*
*/

import java.net.UnknownHostException;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.common.JISystem;
import org.jinterop.dcom.core.IJIComObject;
import org.jinterop.dcom.core.JIComServer;
import org.jinterop.dcom.core.JIProgId;
import org.jinterop.dcom.core.JISession;
import org.jinterop.dcom.core.JIString;
import org.jinterop.dcom.core.JIVariant;
import org.jinterop.dcom.impls.JIObjectFactory;
import org.jinterop.dcom.impls.automation.IJIDispatch;

public class MSWord {

private JIComServer comStub = null;

private IJIDispatch dispatch = null;

private IJIComObject unknown = null;

private IJIDispatch PDF = null;

private JIString PRINTER = null;

public MSWord(String address, String[] args, IJIDispatch PDF, JIString PRINTER)
throws JIException, UnknownHostException {

this.PDF = PDF;
this.PRINTER = PRINTER;

JISession session = JISession.createSession(args[1], args[2], args[3]);
session.useSessionSecurity(true);
comStub = new JIComServer(JIProgId.valueOf("Word.Application"), address,
session);
}

public void startWord() throws JIException {
unknown = comStub.createInstance();
dispatch = (IJIDispatch)
JIObjectFactory.narrowObject(unknown.queryInterface(IJIDispatch.IID));
}

public void showWord() throws JIException {
int dispId = dispatch.getIDsOfNames("Visible");
JIVariant variant = new JIVariant(Boolean.FALSE);
dispatch.put(dispId, variant);
PDF.callMethod("LicenseOLEServer");
}

public void performOp() throws JIException, InterruptedException {

/* JISystem config *
*
*/

JISystem.setJavaCoClassAutoCollection(true);



System.out.println(((JIVariant)
dispatch.get("Version")).getObjectAsString().getString());
System.out.println(((JIVariant)
dispatch.get("Path")).getObjectAsString().getString());
JIVariant variant = dispatch.get("Documents");

System.out.println("Open document...");
IJIDispatch documents = (IJIDispatch)
JIObjectFactory.narrowObject(variant.getObjectAsComObject());
JIString filePath = new JIString("c:\\temp\\test.doc");
JIVariant variant2[] = documents.callMethodA("open", new Object[] {
filePath, JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(),
JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(),
JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(),
JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM() ,JIVariant.OPTIONAL_PARAM(),
JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM() , JIVariant.OPTIONAL_PARAM() });

System.out.println("doc opened");
//ActivePrinter
dispatch.put("ActivePrinter", new Object[]{PRINTER});

sleep(5);
System.out.println("Get content...");
IJIDispatch document = (IJIDispatch)
JIObjectFactory.narrowObject(variant2[0].getObjectAsComObject());

sleep(5);
System.out.println("Printing...");
document.callMethod("PrintOut", new Object[] {1});

System.out.println("Closing document...");
document.callMethod("Close");

}

private void sleep(int sec) throws InterruptedException {
System.out.println("Sleeping "+sec+" second(s)...");
Thread.sleep( (int)(sec * 1000) );
}

/**
* @throws JIException
*/

public void quitAndDestroy() throws JIException {
System.out.println("Quit...");
dispatch.callMethod("Quit", new Object[] { new JIVariant(-1, true),
JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM() });
JISession.destroySession(dispatch.getAssociatedSession());
}

}
Add comment
Name:
Email:
* Comment:
(Use BBcode - No HTML)


Others in this Category
document [novaPDF SDK] - Do I have to open or activate a profile before trying to set an option for the printer driver?
document [novaPDF SDK] - Is there an option not to open the uninstall feedback page when novaPDF is uninstalled?
document CSharp Converter - SDK sample
document Distributing novaPDF with 32bit applications that run on Windows x64
document Word OLE VBNet - SDK sample
» More articles
RSS

Legal Notices Terms of Use

Copyright Softland 2009. All rights reserved.