New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use pages from a PDF as a figure, they will get exported as PNG and the file name will be printed #118
Comments
Can you make a MWE for this issue? I cannot reproduce it with this sample: \documentclass{article}
\usepackage{graphicx}
\begin{document}
Hello figure
\begin{figure}
\includegraphics[page=2]{sample.pdf}
\end{figure}
\end{document} PDF files are converted either to PNG, or to SVG, if you select it as the output graphic format using
|
Ah, I just noticed that it will do the PNG conversion also for the single page figure. Also thanks for the hint that SVG can be specified, which is great to know! I'll try to give a MWE. |
Hm, I tested your MWE and also got the error there. |
Alright, problem found. The spaces in the file name seem to cause it. When I remove them, your MWE doesn't give the error anymore. So I think, it is wanted to fix this problem, right? |
Ah, I see. Spaces in filenames indeed cause this bug. I will fix that in TeX4ht sources. In the meantime, you can use this configuration file: \Preamble{xhtml}
\catcode`\:=11
\makeatletter
\Configure{graphics*}
{pdf}
{\ifdefined\Gin@page\else\def\Gin@page{1}\fi%
\edef\svg:filename{\Gin@base-\Gin@page.\a:PdfConvert}%
% test for existence of the converted file
\openin15={\svg:filename}\relax
\ifeof15
\Needs{\b:PdfConvert}%
\fi
\closein15
{ \Configure{Needs}{File: \svg:filename}\Needs{}}%
\Picture[\a:GraphicsAlt]{{\svg:filename} \csname a:Gin-dim\endcsname
}}
\makeatother
\catcode`\:=12
\begin{document}
\EndPreamble |
Great! (I might also not use spaces in the meantime). I guess you'll notify again when this is fixed in the sources. Thanks again for your support with this! |
You can see changes in the sources here: https://tug.org/tex4ht/changelog.html It will be available in TeX Live soon, most likely in few days. |
That's awesome, thanks! |
Finally had time for testing. Confirm that it works perfectly now with the latest package on TeX Live! Thanks again for your quick fix! |
See the image: Usually, "Publishing Logo-2.png" shouldn't be printed. The figure is from the file "Publishing Logo.pdf", page 2.
I assume, tex4ebook generates PNGs (maybe as a fallback)? Single page PDF figures work for me.
The text was updated successfully, but these errors were encountered: