Free Support Forum - groupdocs.com

Problem when converting to PDF

Estoy teniendo un problema con la biblioteca para la conversión a archivo de MS Word a un archivo PDF que me da los resultados en el siguiente mensaje, necesito el apoyo a una solución.

Excepción en el hilo java.lang.OutOfMemoryError "principal": espacio de almacenamiento dinámico de Java
en com.sun.imageio.plugins.png.PNGImageReader.readMetadata (PNGImageReader.java:745)
en com.sun.imageio.plugins.png.PNGImageReader.readImage (PNGImageReader.java:1229)
en com.sun.imageio.plugins.png.PNGImageReader.read (PNGImageReader.java:1577)
en javax.imageio.ImageReader.read (ImageReader.java:940)
en pN.a (origen desconocido)
en pN.a (origen desconocido)
PN. (origen desconocido)
en xo.b (origen desconocido)
en xo.i (origen desconocido)
en nI.p (origen desconocido)
en nI.b (origen desconocido)
en ow.a (origen desconocido)
en ow.u (origen desconocido)
en oy.endDocument (origen desconocido)
en nj.endDocument (origen desconocido)
en com.groupdocs.conversion.internal.cawSJ.a (origen desconocido)
en com.groupdocs.conversion.internal.cawiX.a (origen desconocido)
en com.groupdocs.conversion.internal.cawar.a (origen desconocido)
en com.groupdocs.conversion.internal.cawar.a (origen desconocido)
en com.groupdocs.conversion.internal.cawar.a (origen desconocido)
en com.groupdocs.conversion.internal.cawar.a (origen desconocido)
en U.toPdf (origen desconocido)
en U.toPdf (origen desconocido)
en ah.a (origen desconocido)
en com.groupdocs.conversion.handler.ConversionHandler.convertToPdf (origen desconocido)
en com.groupdocs.conversion.handler.ConversionHandler.convertToPdf (origen desconocido)
en democonverter.TConverter.WordToPdfFile (TConverter.java:331)
en democonverter.TConverter.TemporaryPkcs7ToPdfExt (TConverter.java:571)
en democonverter.DemoConverter.main (DemoConverter.java:16)
Java Resultado: 1

El archivo de MS Word tiene la característica de una imagen, que se anexionó el ejemplo de este archivo.
Hello,

Thank you for your inquiry.

Unfortunately, this forum supports only English language, but from the error we can assume that it depends from small Java Heap Space . Please try to increase -Xms -Xmx Java options.

If it not help you then please share with us your code example with which you have the issue.

----------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

Hi.
I share the code example with wich i have the issue, modify the parameters -xmx java options and i have a new error which I share too.


Code example:
public void WordToPdfFile(ConversionHandler conversionHandler, String source, String target) throws Exception {
java.io.File file = new java.io.File (source);
String path = file.getParent ();
String fileName = file.getName ();
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions ();
pdfSaveOptions.setSavePath (path);
pdfSaveOptions.setSaveName (fileName);
try{
String savedPath = conversionHandler.convertToPdf (source, pdfSaveOptions);
}catch(RuntimeException re){
re.printStackTrace ();
}
String savedPath = conversionHandler.convertToPdf (source, pdfSaveOptions);
System.out.println (savedPath);
TUtil util = new TUtil ();
util.RenameFile (savedPath, target);
}

This is the error without any parameter :

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
at javax.imageio.ImageReader.read(ImageReader.java:940)
at pN.a(Unknown Source)
at pN.a(Unknown Source)
at pN.(Unknown Source)
at xo.b(Unknown Source)
at xo.i(Unknown Source)
at nI.p(Unknown Source)
at nI.b(Unknown Source)
at ow.a(Unknown Source)
at ow.u(Unknown Source)
at oy.endDocument(Unknown Source)
at nj.endDocument(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.SJ.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.iX.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at U.toPdf(Unknown Source)
at U.toPdf(Unknown Source)
at ah.a(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToPdf(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToPdf(Unknown Source)
at democonverter.TConverter.WordToPdfFile(TConverter.java:332)
at democonverter.TConverter.TemporaryPkcs7ToPdfExt(TConverter.java:576)
at democonverter.DemoConverter.main(DemoConverter.java:16)


This is the error that get with the option -Xmx3072m

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.groupdocs.conversion.internal.j.m.jai.ar com.groupdocs.conversion.internal.j.m.jai.aR com.groupdocs.conversion.internal.j.m.jai.aR.(Unknown Source)
at com.groupdocs.conversion.internal.j.m.jai.aR.a(Unknown Source)
at com.groupdocs.conversion.internal.j.m.jai.al.d(Unknown Source)
at com.groupdocs.conversion.internal.j.m.jai.X.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at pM.a(Unknown Source)
at pN.e(Unknown Source)
at pN.a(Unknown Source)
at pN.(Unknown Source)
at xo.b(Unknown Source)
at xo.i(Unknown Source)
at nI.p(Unknown Source)
at nI.b(Unknown Source)
at ow.a(Unknown Source)
at ow.u(Unknown Source)
at oy.endDocument(Unknown Source)
at nj.endDocument(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.SJ.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.iX.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at com.groupdocs.conversion.internal.c.a.w.ar.a(Unknown Source)
at U.toPdf(Unknown Source)
at U.toPdf(Unknown Source)
at ah.a(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToPdf(Unknown Source)
at com.groupdocs.conversion.handler.ConversionHandler.convertToPdf(Unknown Source)
at democonverter.TConverter.WordToPdfFile(TConverter.java:332)
at democonverter.TConverter.TemporaryPkcs7ToPdfExt(TConverter.java:576)
at democonverter.DemoConverter.main(DemoConverter.java:16)
Caused by: java.lang.NullPointerException
at com.groupdocs.conversion.internal.j.m.jai.registry.k.b(Unknown Source)
Hello,

Thank you for your details.

We have reproduced this issue on our side and our Product team was informed about it. This issue will be fixed in the new generation of the GroupDocs.Conversion for Java library, that should be released soon.

We apologize for the inconvenience.

---------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

hi.


They may indicate an estimated date.
I answer my customers the date of the solution to this issue.

Best regards
Hello,

We expect, that the version will be released at the end of this month. Please stay tuned for our newsletters.

If you will have more questions please feel free to contact us.

---------

Best regards,
Evgen Efimov

http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+

Hello,



When the update will be available, the client continues with the problem, we are requesting an approximate date.

Hi There,

Thanks for your patience.

We are pleased to apprise you that Next Generation GroupDocs.Conversion for Java has been released. Let us breif you about this new API. Next Generation GroupDocs.Conversion for Java is a totally back-end, UI-Independent API that can be integrated in any Java project without any dependency issue.
This advanced API allows you to convert back and forth between over 50 document formats from within your Java applications.

You may find following resource very helpful:

Download
Documentation
Examples

Please go through these resource and share your experience.

Best Wishes