Juan Manuel created PDFBOX-4264:
-----------------------------------
Summary: PDDocument.load(fileToPrint) doesn't work when execute as
windows service
Key: PDFBOX-4264
URL: https://issues.apache.org/jira/browse/PDFBOX-4264
Project: PDFBox
Issue Type: Bug
Components: Parsing
Affects Versions: 1.8.15
Environment: Windows 7 Pro 64 bits.
JDK 1.7.0_51
Reporter: Juan Manuel
Attachments: 119724.pdf
I have the following code that works perfect when I run the program from any
user. The problem arises when he tried to execute it as a windows service. This
service is configured to be executed with the same user with whom I am logged
in. How is a windows service, I can not make outputs, so I resorted to register
in my text files the activity of my program. And everything works until you
have to execute the line: PDDocument.load After this line the program does not
continue and does not issue execpciones to capture. The JDK that I use is
1.7.0._51.
I have tried with the latest version of PDBOX and it has not fixed.
I have verified execution, reading and modification permissions. Tested with
absolute paths. Anyway, everything.
Thanks for your interest.
regards
{code:java}
File fileToPrint = new File(rutaNombreArchivo);
PDDocument load = PDDocument.load(fileToPrint.toString());
// PDDocument load = PDDocument.loadNonSeq(fileToPrint,null);
try {
final PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintService(services[selectedService]);
printJob.setJobName(fileToPrint.getName());
final HashPrintRequestAttributeSet printRequestAttributes = new
HashPrintRequestAttributeSet();
printJob.print(printRequestAttributes);
for (int i = 1; i <= cantVia; i++) {
load.silentPrint(printJob);
}
} catch (final PrinterException e) {
Log.addLog(Log.tipoMensaje.ErrorGenerico, e.getMessage());
// e.printStackTrace();
} finally {
if (load != null) {
load.close();
}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]