Export to pdf error
Asked by license_all:

Please, help.

![2018-03-05_125822.jpg](/t5/image/serverpage/image-id/16339i6BE6B18280818851/image-size/large?v=v2&px=999 "2018-03-05_125822.jpg")

**2018-03-05 12:48:27** ,368 WARN \[Long running task: PDF Space Export\] \[confluence.extra.flyingpdf.ConfluenceExportUserAgent\] getImageResource Could not retrieve image resource http://wiki:8090/download/attachments/18087962/%D0%91%D0%B5%D0%B7%D1%8B%D0%BC%D1%8F%D0%BD%D0%BD%D1%8B%D0%B9.jpg?version=1\&modificationDate=1494587768530\&api=v2 during Confluence export  
-- url: /spaces/flyingpdf/doflyingpdf.action \| traceId: aed7a1f8caf95809 \| userName: i.agranovskiy \| referer: http://wiki:8090/spaces/flyingpdf/flyingpdf.action?key=Infra \| action: doflyingpdf  
2018-03-05 12:48:33,559 WARN \[Long running task: PDF Space Export\] \[confluence.extra.flyingpdf.ConfluenceExportUserAgent\] getImageResource Could not retrieve image resource http://wiki:8090/download/attachments/13271375/image2014-9-18%2019%3A2%3A36.png?version=1\&modificationDate=1411052557553\&api=v2 during Confluence export  
-- url: /spaces/flyingpdf/doflyingpdf.action \| traceId: aed7a1f8caf95809 \| userName: i.agranovskiy \| referer: http://wiki:8090/spaces/flyingpdf/flyingpdf.action?key=Infra \| action: doflyingpdf  
**2018-03-05 12:48:33** ,619 WARN \[Long running task: PDF Space Export\] \[confluence.extra.flyingpdf.ConfluenceExportUserAgent\] getImageResource Could not retrieve image resource http://wiki:8090/download/attachments/13271375/image2014-9-18%2019%3A2%3A36.png?version=1\&modificationDate=1411052557553\&api=v2 during Confluence export  
-- url: /spaces/flyingpdf/doflyingpdf.action \| traceId: aed7a1f8caf95809 \| userName: i.agranovskiy \| referer: http://wiki:8090/spaces/flyingpdf/flyingpdf.action?key=Infra \| action: doflyingpdf  
**2018-03-05 12:48:36** ,094 ERROR \[Long running task: PDF Space Export\] \[core.task.longrunning.AbstractLongRunningTask\] doInTransactionWithoutResult Error during PDF export  
-- url: /spaces/flyingpdf/doflyingpdf.action \| traceId: aed7a1f8caf95809 \| userName: i.agranovskiy \| referer: http://wiki:8090/spaces/flyingpdf/flyingpdf.action?key=Infra \| action: doflyingpdf  
com.atlassian.confluence.importexport.ImportExportException: Exception while rendering the PDF document C:\\Program Files\\Atlassian\\Application Data\\Confluence\\temp\\pdfexport-20180305-050318-1248-11\\Infra-050318-1248-12.pdf  
at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:104)  
at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForSpace(FlyingSaucerPdfExporterService.java:66)  
at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask$1.doInTransactionWithoutResult(PdfExportLongRunningTask.java:92)  
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)  
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)  
at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask.doRunInternal(PdfExportLongRunningTask.java:74)  
at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask.runInternal(PdfExportLongRunningTask.java:59)  
at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26)  
at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:52)  
at com.atlassian.confluence.impl.util.concurrent.ConfluenceExecutors$ThreadLocalContextTaskWrapper.lambda$wrap$1(ConfluenceExecutors.java:90)  
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)  
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:87)  
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:71)  
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)  
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$withRequestContext$2(VCacheRequestContextOperations.java:66)  
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at java.lang.Thread.run(Thread.java:748)  
Caused by: java.lang.RuntimeException: Failed to read image  
at com.atlassian.confluence.extra.flyingpdf.LightITextFSImage.getImage(LightITextFSImage.java:247)  
at org.xhtmlrenderer.pdf.ITextOutputDevice.drawImage(ITextOutputDevice.java:828)  
at org.xhtmlrenderer.pdf.ITextImageElement.paint(ITextImageElement.java:72)  
at org.xhtmlrenderer.pdf.ITextOutputDevice.paintReplacedElement(ITextOutputDevice.java:199)  
at org.xhtmlrenderer.layout.Layer.paintReplacedElement(Layer.java:540)  
at org.xhtmlrenderer.layout.Layer.paintReplacedElements(Layer.java:497)  
at org.xhtmlrenderer.layout.Layer.paintAsLayer(Layer.java:471)  
at org.xhtmlrenderer.render.BlockBox.paintInline(BlockBox.java:265)  
at org.xhtmlrenderer.layout.Layer.paintInlineContent(Layer.java:274)  
at org.xhtmlrenderer.layout.Layer.paint(Layer.java:332)  
at org.xhtmlrenderer.pdf.ITextRenderer.paintPage(ITextRenderer.java:432)  
at org.xhtmlrenderer.pdf.ITextRenderer.writePDF(ITextRenderer.java:380)  
at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:333)  
at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:265)  
at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:93)  
... 19 more  
Caused by: java.lang.RuntimeException: Failed to read image  
at com.atlassian.confluence.extra.flyingpdf.LightITextFSImage.getImage(LightITextFSImage.java:216)  
... 33 more  
**2018-03-05 12:51:01**,371 WARN \[Caesium-1-4\] \[impl.schedule.caesium.JobRunnerWrapper\] runJob Scheduled job LaasPerformanceLoggingJob#LaasPerformanceLoggingJob completed unsuccessfully with response JobRunnerResponse\[runOutcome=ABORTED,message='LaaS performance logging is turned off'\]


Answers:
author: Ameya Gabale
body: I am facing a similar issue. Some images do not load when exported as PDF. This happens at random for various articles. What can be the reason?


author: Shannon S
body: Hello,

This error is usually due to a corrupt file on one of your pages, such as a .png image.

You will want to narrow down which page has the issue.

You can try this by breaking down your space export into smaller chunks. Choose 'Custom Export' instead of all pages, selecting the first section, and see if you have issues. If not, then go onto the next section, and so forth.

Let us know if you have any trouble.

Shannon

comments: author: license_all
body: I noticed that in some pages with an attachment such an error. I created the page again. Without a picture, it is unloaded into the PDF file normally, with a picture (24k) - error. "Failed during PDF export. Exception message - Could not close the export file C:\\Program Files\\Atlassian\\Application Data\\Confluence\\temp\\pdfexport-20180306-060318-0921-166\\Infra-060318-0921-167.pdf".

Also there is a problem of displaying pages when uploading. How can you solve these 2 problems?

![2018-03-06_092300.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/16430iA69DEB45DD7A1DC4/image-size/large?v=v2&px=999 "2018-03-06_092300.jpg")


author: license_all
body: ![2018-03-06_094258.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/16432i401E861D175E09CA/image-size/large?v=v2&px=999 "2018-03-06_094258.jpg")


author: Shannon S
body: Hi there,

The display issue is likely a separate error. I would recommend [troubleshooting your Character Encodings](https://confluence.atlassian.com/doc/troubleshooting-character-encodings-167194.html) and if that doesn't work, you can raise a new question for it or a [support ticket](https://support.atlassian.com/contact/#/).

As for the PDF export working without the image, then you can be sure that there is an issue with that image in particular.

You will want to try to get a different copy of that image that will not cause Confluence to fail.

Regards,

Shannon


author: license_all
body: The picture was done in different ways. The problem remains. jpg and png is the same.


author: Shannon S
body: 1. How large is the image exactly?
2. Is it attached directly to the page or from an external URL?
3. What generated the image?
4. Could you post ANY OTHER image on the page and you still have issues?

Regards,

Shannon


author: license_all
body: 1. 10-210 Kb

2. Attached directly to the page

3. FSCapture or windows snipping tool

4. Already tried. Does not help.


author: Shannon S
body: Hi there,

Apologies, I meant the resolution of the image. We have a current bug where high-resolution images are causing issues with PDF export.

Lastly - you said that attaching an image from elsewhere on the page doesn't help - you mean that you could take any image from anywhere including on the internet and you would still have the same problem?

Regards,

Shannon


author: license_all
body: 172\*171, 210\*403 screenshots. 1024\*768 windows standart pictures.

Yes, with any picture even from the Internet, problems.


author: Shannon S
body: Hi there,

Thank you for confirming that.

So, on any page in the space, if you add any image at all, it doesn't export. Correct?

If you were to do this on any other page in the entire instance, the same behavior occurs?

Finally, what is your Confluence version?

Regards,

Shannon


author: license_all
body: yes.

yes.

6.6.1


author: Shannon S
body: Thank you for confirming.

We need to have a look at your setup, so I have created a support ticket for you so we can obtain that information.

You'll receive an email with the support ticket number. Can you please upload your Support Zip to the ticket number you'll find on this URL?

* [transfer.atlassian.io](https://transfer.atlassian.io)

Thank you for your help.

Regards,

Shannon