Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

LaTeX PDF export problem Confluence 5.5

MilanCiti October 14, 2014

Hello

I have an issue with PDF Export of certain page, which has latex macro used on it.

Without latex macro, PDF export works fine.

Error message : Failed during PDF export. Exception message - Exception thrown while rendering the page 'Experiment to test Latex plugin' to the PDF document <confluenceHomeDirectory>/temp/pdfexport-20141014-141014-1707-7/TEST-141014-1707-8.pdf

Test page itself look fine, with simple usage of latex macro :

{latex} \( E=mc^{2} \) {latex}

LaTeX plugin version 1.4, Confluence 5.5, Java 1.7.

I properly set up paths for latex and dvipng under that 'Configure' for LaTeX plugin.

 

Part of the log:

2014-10-14 17:07:17,561 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Started the LaTeX markup to PNG file conversion.
2014-10-14 17:07:17,565 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Latex Properties: {dvipng.parameters=-T;tight;-bg;transparent;}
2014-10-14 17:07:17,566 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Creating a new tex file with some wiki markup.
2014-10-14 17:07:17,566 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Parameter 'rawMarkup' is: false
2014-10-14 17:07:17,567 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Parameter 'packages' is: null
2014-10-14 17:07:17,569 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Writing the LaTeX header:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{bm}
\newcommand{\mx}[1]{\mathbf{\bm{#1}}} % Matrix command
\newcommand{\vc}[1]{\mathbf{\bm{#1}}} % Vector command
\newcommand{\T}{\text{T}} % Transpose
\pagestyle{empty}
\begin{document}

2014-10-14 17:07:17,574 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg A new TEX file has been created: LaTeX2559712004876501941.tex
2014-10-14 17:07:17,575 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg The common working directory is set to: <confluenceHomeDirectory>/temp
2014-10-14 17:07:17,575 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg The common filename is set to: LaTeX2559712004876501941
2014-10-14 17:07:17,576 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Starting writing LaTeX markup to: LaTeX2559712004876501941.tex
2014-10-14 17:07:17,583 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Finished writing LaTeX markup to: LaTeX2559712004876501941.tex
2014-10-14 17:07:17,584 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg The tex file should be created and called: LaTeX2559712004876501941.tex
2014-10-14 17:07:17,584 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Creating new dvi file from the tex file using the command: /texlive/bin/x86_64-linux/latex
2014-10-14 17:07:17,587 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Running process: '/texlive/bin/x86_64-linux/latex' using the arguments:
2014-10-14 17:07:17,587 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 1 = -interaction=batchmode
2014-10-14 17:07:17,588 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg In working directory: <confluenceHomeDirectory>/temp
2014-10-14 17:07:18,137 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg The dvi file should be created and called: LaTeX2559712004876501941.dvi
2014-10-14 17:07:18,138 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Creating new png file from the dvi file using the command: /eur/development/FIQA_developers/texlive/bin/x86_64-linux/dvipng
2014-10-14 17:07:18,148 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Running process: '/texlive/bin/x86_64-linux/dvipng' using the arguments:
2014-10-14 17:07:18,148 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 1 = -T
2014-10-14 17:07:18,149 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 2 = tight
2014-10-14 17:07:18,150 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 3 = -bg
2014-10-14 17:07:18,150 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 4 = transparent
2014-10-14 17:07:18,151 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 5 = -o
2014-10-14 17:07:18,152 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg ... arg 6 = <confluenceHomeDirectory>/temp/LaTeX4618698193073529946.png
2014-10-14 17:07:18,152 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg In working directory: <confluenceHomeDirectory>/temp
2014-10-14 17:07:18,432 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg The png file should be created and called: LaTeX2559712004876501941.png
2014-10-14 17:07:18,433 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Started cleaning up all generated files from the conversion process.
2014-10-14 17:07:18,445 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Removing generated file: LaTeX2559712004876501941.tex
2014-10-14 17:07:18,449 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Removing generated file: LaTeX2559712004876501941.log
2014-10-14 17:07:18,454 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Removing generated file: LaTeX2559712004876501941.aux
2014-10-14 17:07:18,457 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Removing generated file: LaTeX2559712004876501941.dvi
2014-10-14 17:07:18,458 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Finished cleaning up all generated files from the conversion process.
2014-10-14 17:07:18,458 DEBUG [Long running task: PDF Space Export] [confluence.plugins.latex.LatexMacro] debugMsg Returning the location of the new PNG file: <img src='/download/temp/LaTeX4618698193073529946.png?contentType=image/png&delete=true'/>
2014-10-14 17:07:18,459 INFO [Long running task: PDF Space Export] [confluence.velocity.htmlsafe.PossibleIncorrectHtmlEncodingEventHandler] annotatedValueInsert $contentHtml in templates/extra/pdfexport/pagehtml.vm
2014-10-14 17:07:18,475 INFO [Long running task: PDF Space Export] [confluence.velocity.htmlsafe.PossibleIncorrectHtmlEncodingEventHandler] annotatedValueInsert $pageHtml in templates/extra/pdfexport/completeexport.vm
2014-10-14 17:07:19,230 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog style/form-min.css
2014-10-14 17:07:19,236 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog style/gadgets-min.css
2014-10-14 17:07:19,238 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog style/gadget-directory-dialog-min.css
2014-10-14 17:07:19,265 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog user-select2/user-select2-less.css
2014-10-14 17:07:19,267 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog com/atlassian/confluence/plugins/createcontent/css/create-dialog-less.css
2014-10-14 17:07:19,270 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog com/atlassian/confluence/plugins/createcontent/css/promoted-less.css
2014-10-14 17:07:19,300 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog com/atlassian/confluence/plugins/createcontent/css/space-dialog-wizard-common-less.css
2014-10-14 17:07:19,302 DEBUG [Long running task: PDF Space Export] [osgi.container.felix.FelixOsgiContainerManager] doLog css/keyboard-shortcuts-min.css
2014-10-14 17:07:19,488 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.cookie.DefaultCookieHandler] getCookie Looking for a cookie named : 'confluence-language'
2014-10-14 17:07:19,490 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.cookie.DefaultCookieHandler] getCookie The Cookies array in the HTTP request is null
2014-10-14 17:07:19,491 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.filter.BaseLoginFilter] doFilter doFilter : ____ Attempting login for : '/download/temp/LaTeX4618698193073529946.png?contentType=image/png&delete=true'
2014-10-14 17:07:19,493 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.filter.PasswordBasedLoginFilter] login login : No user name or password was returned. No authentication attempt will be made. User may still be found via a SecurityFilter later.
2014-10-14 17:07:19,494 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.filter.BaseLoginFilter] doFilter doFilter : Login completed for 'null' - os_authstatus = 'null'
2014-10-14 17:07:19,495 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.filter.SecurityFilter] doFilter doFilter : Storing the originally requested URL (atlassian.core.seraph.original.url=/download/temp/LaTeX4618698193073529946.png?contentType=image/png&delete=true)
2014-10-14 17:07:19,497 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.filter.SecurityFilter] doFilter doFilter : requiredRoles = []
2014-10-14 17:07:19,498 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.auth.DefaultAuthenticator] getUserFromCookie getUserFromCookie : Got username : 'null' from cookie, attempting to authenticate user is known
2014-10-14 17:07:19,499 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.auth.DefaultAuthenticator] getUser getUser : User not found in either Session, Cookie or Basic Auth.
2014-10-14 17:07:19,500 DEBUG [http-bio-8279-exec-16] [atlassian.seraph.filter.SecurityFilter] doFilter doFilter : Setting Auth Context to be 'anonymous '
2014-10-14 17:07:19,502 ERROR [http-bio-8279-exec-16] [confluence.servlet.download.ExportDownload] getStreamForDownload Unauthorized attempt to access resource by null. For more detail turn on INFO level logging for package : com.atlassian.confluence.servlet.download
-- url: /download/temp/LaTeX4618698193073529946.png | userName: anonymous
2014-10-14 17:07:19,505 INFO [http-bio-8279-exec-16] [confluence.servlet.download.ExportDownload] getStreamForDownload More detail for unauthorized attempt to access resource:
-- url: /download/temp/LaTeX4618698193073529946.png | userName: anonymous
com.atlassian.confluence.importexport.resource.UnauthorizedDownloadResourceException
at com.atlassian.confluence.importexport.resource.ExportDownloadResourceManager.getResourceReader(ExportDownloadResourceManager.java:67) ... more lines regarding this info


2014-10-14 17:07:19,511 ERROR [Long running task: PDF Space Export] [core.task.longrunning.AbstractLongRunningTask] doInTransactionWithoutResult Error during PDF export
-- url: /spaces/flyingpdf/doflyingpdf.action | userName: <myusername> | referer: http://<confluence_address>/spaces/flyingpdf/flyingpdf.action?key=TEST | action: doflyingpdf
com.atlassian.confluence.importexport.ImportExportException: Exception thrown while rendering the page 'Experiment to test Latex plugin' to the PDF document <confluenceHomeDirectory>/temp/pdfexport-20141014-141014-1707-7/TEST-141014-1707-8.pdf
at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:94)
at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForSpace(FlyingSaucerPdfExporterService.java:60)
at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask$1.doInTransactionWithoutResult(PdfExportLongRunningTask.java:72)
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at com.atlassian.confluence.extra.flyingpdf.PdfExportLongRunningTask.runInternal(PdfExportLongRunningTask.java:52)
at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26)
at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Failed to read image
at com.atlassian.confluence.extra.flyingpdf.LightITextFSImage.getImage(LightITextFSImage.java:128)
at org.xhtmlrenderer.pdf.ITextOutputDevice.drawImage(ITextOutputDevice.java:768)
at org.xhtmlrenderer.pdf.ITextImageElement.paint(ITextImageElement.java:72)
at org.xhtmlrenderer.pdf.ITextOutputDevice.paintReplacedElement(ITextOutputDevice.java:183)
at org.xhtmlrenderer.layout.Layer.paintReplacedElement(Layer.java:554)
at org.xhtmlrenderer.layout.Layer.paintReplacedElements(Layer.java:511)
at org.xhtmlrenderer.layout.Layer.paintAsLayer(Layer.java:485)
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:346)
at org.xhtmlrenderer.pdf.ITextRenderer.paintPage(ITextRenderer.java:384)
at org.xhtmlrenderer.pdf.ITextRenderer.writePDF(ITextRenderer.java:348)
at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:315)
at org.xhtmlrenderer.pdf.ITextRenderer.createPDF(ITextRenderer.java:246)
at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:77)
... 13 more
Caused by: java.lang.NullPointerException
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
at com.atlassian.confluence.extra.flyingpdf.LightITextFSImage.getImage(LightITextFSImage.java:120)
... 27 more

 

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Tim Stavenger March 9, 2015

I've had success exporting individual pages to PDF using this custom user macro that uses the mathTeX CGI script: https://davidsimpson.me/2012/02/20/how-to-export-confluence-pages-containing-equations-to-pdf/

I have not yet tried exporting an entire space where some pages make use of this plugin.

See also http://www.forkosh.com/mathtex.html

0 votes
t t February 24, 2015

you find problem workaround?

0 votes
t t February 24, 2015

We have this problem too

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events