I have read that to can enabled the preview of files different than PDF, like mobi files, I have to compile the project after modifying the premake5.lua file.
I am trying to compile with Visual Studio 2022 community.
The process that I follow is this:
1.- I download the code of sumatra. In this case the last version, 3.4.
2.- Edit the premake5.lua file and I search for this lines:
pdf_preview_files()
filter {"configurations:Debug"}
-- defines { "BUILD_XPS_PREVIEW" }
-- TODO: use EngineMupdf for XPS
defines {
"BUILD_DJVU_PREVIEW", "BUILD_EPUB_PREVIEW",
"BUILD_FB2_PREVIEW", "BUILD_MOBI_PREVIEW", "BUILD_CBZ_PREVIEW",
"BUILD_CBR_PREVIEW", "BUILD_CB7_PREVIEW", "BUILD_CBT_PREVIEW",
"BUILD_TGA_PREVIEW"
}
filter {}
-- TODO: "chm" should only be for Debug config but doing links { "chm" }
-- in the filter breaks linking by setting LinkLibraryDependencies to false
links { "utils", "unrar", "libmupdf", "chm" }
links { "comctl32", "gdiplus", "msimg32", "shlwapi", "version" }
After this code, I added this code:
pdf_preview_files()
**filter {"configurations:Release"}**
-- defines { "BUILD_XPS_PREVIEW" }
-- TODO: use EngineMupdf for XPS
defines {
"BUILD_DJVU_PREVIEW", "BUILD_EPUB_PREVIEW",
"BUILD_FB2_PREVIEW", "BUILD_MOBI_PREVIEW", "BUILD_CBZ_PREVIEW",
"BUILD_CBR_PREVIEW", "BUILD_CB7_PREVIEW", "BUILD_CBT_PREVIEW",
"BUILD_TGA_PREVIEW"
}
filter {}
-- TODO: "chm" should only be for Debug config but doing links { "chm" }
-- in the filter breaks linking by setting LinkLibraryDependencies to false
links { "utils", "unrar", "libmupdf", "chm" }
links { "comctl32", "gdiplus", "msimg32", "shlwapi", "version" }
Just I copy the code of the debug configuration and set it as release.
3.- I Install Go. If I am not wrong, it is needed to rebuild the project and create the new projects of Visual Studio.
4.- I run the doit.bat file to regenerate the files of the project.
5.- I open the SumatraPdf.sln file in visual studio.
6.- I compile the solution in x64.
7.- I get the result in the folder “rel64”.
8.- Copy all the folder to my applications folder. It is about 900MB of data. It is not like when I download the application from the web, that is only 4 files and few megabytes.
9.- I Configure this compiled version of sumatra as default application to open the mobi files.
But I only see a icon with “PDF” text and i can’t see anything in the preview pane.
I am compile in the wrong way? I have to configure something in windows after compile it?
Thanks.