-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversion of PDF graphics to SVG using the svg
option doesn't work
#120
Comments
I've found this later too. It seems that PNG is hardcoded as the output image format for Epub. But SVG seems to work with Epub 3. I've removed this hardcoded value rrom TeX4ebook sources, so it shouldn't happen in the future. In the meantime, you can select SVG also using this configuration:
|
Yes, Epub should support SVG, but the other question is how well is that supported by reading applications. They often don't support some features. |
True, I'll make sure to test! |
Hm, neither with the update version of Configuration:
Not sure, what causes this, maybe PDF images can't get converted to SVG? |
Can you post output of the |
Sure, here it is:
Then, it stops. |
Ah, I see, with pressing Enter, I can continue the process. However, I think the provided output should already contain the relevant sections. |
The error with adjustwidth is caused by the fact that we expect it to have explicit dimensions in TeX4ht. I've fixed that in the development version. This file, % changepage.4ht (2024-01-04-22:00), generated from tex4ht-4ht.tex
% Copyright 2023 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2024-01-04-22:00}
\NewConfigure{adjustwidth}{2}
\def\:tempa#1#2{%
\edef\adjustwidth:left{\if\relax#1\relax0pt\else#1\fi}%
\edef\adjustwidth:right{\if\relax#2\relax0pt\else#2\fi}%
\a:adjustwidth%
}
\HLet\adjustwidth\:tempa
\expandafter\HLet\csname adjustwidth*\endcsname\:tempa
\def\:tempa{\b:adjustwidth}
\HLet\endadjustwidth\:tempa
\expandafter\HLet\csname endadjustwidth*\endcsname\:tempa
\Hinput{changepage}
\endinput Regarding the output of make4ht, actually the most important stuff in this case in near the end of the output, before files are copied to the output directories. |
Ah, thanks! I managed to find the changed version https://svn.gnu.org.ua/viewvc/tex4ht/trunk/lit/. How do I use the file that you uploaded? I'll provide the full output! |
There is also some log beforehand (it even scrolled out of the terminal), so I hope, I catched the relevant part now. Else, I'll also paste the "middle" part. |
You can put that file to the directory with your TeX file, or wait few days for the TeX Live update. From the terminal output, it seems that
|
Sorry again for the delayed response. I just tested, the For the other issue, with the new config, it seems that now, there are no SVG files created. The log complains about missing files:
Am I missing something, or hitting the next problem? |
It seems that the
|
You are right!
|
Ah, I see. You can try to install |
Mh, probably needs to be installed separately. But I found https://github.com/jalios/pdf2svg-windows which seems to be the source for Windows. Not sure how to use that. Additionally, I saw https://tex.stackexchange.com/a/634821 mentioning that it's unmaintained. And suggesting an alternative that is included in TeX Live and actively maintained. Might that be a possible option (at least in the long run)? |
I don't know how to install
It should output some page dimensions, but on my system, it prints |
Alright. I'll think about it.
Not sure what caused this, I was hoping, TeX Live will ensure things "just work". In the long run, I am hoping for SVG support that "just works" on multiple OSs, but it seems to be far from trivial. |
Maybe the best solution in this case is to convert your PDF files to SVG manually, using for example Inkscape, and include these converted SVG files with TeX4ht. You can use something like |
That is also an option. But it is also not a good workflow, especially if many graphics are used (not the case for me, but still). Let's see, maybe a good solution can be found in the future. In general, I want to support lossless formats like SVG, but might use PNG as workaround for now, or convert manually. |
In #118 (comment), the
svg
option is mentioned to maketex4ebook
convert PDF graphics not to PNG but to SVG. Unfortunately, this doesn't seem to have an effect for me. The graphics are still converted to PNG, even with this option.The text was updated successfully, but these errors were encountered: