| |||
| Estimados, lo que trato de hacer es asignar una password a un pdf, creo un procedimiento en Genexus 9.0 agrego las librerias en el classpath del modelo. y el codigo seria el siguiente :
Código:
java try {
java com.lowagie.text.pdf.PdfReader reader = new com.lowagie.text.pdf.PdfReader("/emision/detalle/Detalle_sinPasword.pdf");
java com.lowagie.text.pdf.PdfEncryptor.encrypt(reader, new java.io.FileOutputStream("/emision/detalle/Detalle_conPasword.pdf"), "Hello".getBytes(), "World".getBytes(), com.lowagie.text.pdf.PdfWriter.AllowPrinting | com.lowagie.text.pdf.PdfWriter.AllowCopy, false);
java } catch (Exception e) {
java System.out.println(e.toString());
java }
Al momento de ejecutar , no de compilar porque lo hace bien al compilar en java me sale este error: java.lang.NoClassDefFoundError at pc/pfsencrip.S114 at pc/pfsencrip.execute_int at pc/pfsencrip.execute at pc/upassword.e12V1CO2 at pc/upassword.actionEventDispatch at com/genexus/ui/GXWorkpanel$runEvent.run at com/genexus/uifactory/wfc/WFCUIFactory.invokeLater at com/genexus/uifactory/UIFactory.invokeLater at com/genexus/ui/GXWorkpanel.buttonActionPerformed at com/genexus/ui/FocusManager.setFocusMouseClicked at com/genexus/ui/FocusManager.mouseClicked at com/genexus/uifactory/wfc/WFCMouseListener.mouseClicked at com/ms/wfc/core/EventHandler.invoke at com/ms/wfc/core/Component.fireEvent at com/ms/wfc/ui/Control.onClick at com/ms/wfc/ui/Button.onClick at com/ms/wfc/ui/Button.wndProc at com/ms/wfc/ui/Control$ControlWindow.wndProc at com/ms/wfc/app/Window.callback at com/ms/wfc/win32/Windows.SendMessage at com/ms/wfc/ui/Control.sendMessage at com/ms/wfc/ui/Control.reflectMessage at com/ms/wfc/ui/Control.wmCommand at com/ms/wfc/ui/Control.wndProc at com/genexus/uifactory/wfc/ScrollPanel.wndProc at com/ms/wfc/ui/Control$ControlWindow.wndProc at com/ms/wfc/app/Window.callback at com/ms/wfc/win32/Windows.CallWindowProc at com/ms/wfc/app/Window.defWndProc at com/ms/wfc/ui/Control$ControlWindow.defWndProc at com/ms/wfc/ui/Control.defWndProc at com/ms/wfc/ui/Control.wmMouseUp at com/ms/wfc/ui/Control.wndProc at com/ms/wfc/ui/Button.wndProc at com/ms/wfc/ui/Control$ControlWindow.wndProc at com/ms/wfc/app/Window.callback at com/ms/wfc/win32/Windows.DispatchMessage at com/ms/wfc/app/Application$ThreadContext.runMessageLoop at com/ms/wfc/app/Application.run at com/ms/wfc/app/Application.run at com/genexus/uifactory/wfc/WFCUIFactory.loopEvents at com/genexus/uifactory/UIFactory.loopEvents at com/genexus/ui/GXWorkpanel.run at com/genexus/ui/GXWorkpanel.start at achs/upassword.execute_int at achs/upassword.execute at achs/upassword.executeCmdLine at achs/upassword.main Ya lo he intentado agregandole un monton de classpath, que he encontrardo: Itext.jar; itext-1.4.6.jar; commons-io-2.1.jar; commons-net-3.0.1.jar; |