[
https://issues.apache.org/jira/browse/PDFBOX-4264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541576#comment-16541576
]
Juan Manuel commented on PDFBOX-4264:
-------------------------------------
I have tried with all combinations of JDK and PDFBox and it does not work. For
some reason, when you try to execute the load the program freezes. Remember
that the problem occurs if my compiled jar is executed as a windows service. If
I run it from a user environment it works perfectly. I do not know what
COSParser is, I will find out.
> 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
> Priority: Blocker
> Attachments: 119724.pdf
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
>
> 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]