pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan Manuel (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (PDFBOX-4264) PDDocument.load(fileToPrint) doesn't work when execute as windows service
Date Wed, 25 Jul 2018 14:03:00 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-4264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Juan Manuel closed PDFBOX-4264.
-------------------------------
    Resolution: Not A Problem

> 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message