0

我正在寻找用于发布软件手册的优质 CMS。

要求:

  • 将手册页发布为带有缩略图的网页,并在单击图像后显示全分辨率,
  • 将手册页导出为具有全分辨率图像的 pdf 文件,而不是缩略图

我发现恕我直言,最好的 wiki 系统名为Tiki Wiki ( https://info.tiki.org/ ),但是当我导出为 pdf 时,我会得到低分辨率的缩略图。

4

1 回答 1

1

我通过非常简单的Tiki Wiki代码修改解决了这个问题:

修改lib/wiki-plugins/wikiplugin_img.php以强制使用完整图像分辨率而不是打印页面模式下的缩略图(插入代码 1)并将生成的 HTML 中的图像重新缩放 0.5 倍(插入代码 2):

[...]

function wikiplugin_img( $data, $params )
{
    [...]

    $imgdata = array_merge($imgdata, $params);

    // inserted code 1 (~410 line)
    if ($GLOBALS['section_class']=="tiki_wiki_page print"){
        $imgdata['thumb'] = '';
    }
    // end of inserted code 1

    //function calls
    if ( !empty($imgdata['default']) || !empty($imgdata['mandatory'])) {

    [...]

    $fwidth = '';
    $fheight = '';
    if (isset(TikiLib::lib('parser')->option['indexing']) && TikiLib::lib('parser')->option['indexing']) {
        $fwidth = 1;
        $fheight = 1;
    } else {

        // inserted code 2 (~410 line)
        if ($GLOBALS['section_class']=="tiki_wiki_page print"){
            $fwidth = $imageObj->get_width() / 2;
            $fheight = $imageObj->get_height() / 2;
        } else {
            $fwidth = $imageObj->get_width();
            $fheight = $imageObj->get_height();
        }
        // end of inserted code 2 (~638 line)

     }

[...]

现在,在通过wkhtmltopdf打印为 pdf 后,我们得到了带有小但全分辨率图像的 pdf。

附加修改:

  • 在cms/cssmenus.css (或打印模式中包含的其他 css)中添加以下行以增加图像标题的底部边距:

    div.thumbcaption {
        margin-bottom: 5mm;
    }
    
  • 删除templates/tiki-show_content.tpl中从 171 到 ~175的行,以删除“原始文档位于”脚。

于 2014-06-15T07:55:14.170 回答