CMS和存储高分辨率图像生成的pdf [英] CMS and store hi-resolution images in generated pdf

查看:354
本文介绍了CMS和存储高分辨率图像生成的pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找适合发布软件手册的CMS。



要求:


$ b b

  • 将手动网页以缩略图的形式发布为网页,并在点击图片后显示完全分辨率。

  • 将手动网页导出为pdf文件
  • https://info.tiki.org/ ),但是当我导出到pdf然后我得到低分辨率缩略图。

    解决方案

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



    修改 lib / wiki-plugins / wikiplugin_img.php 以强制使用全图像分辨率代替缩略图在打印页模式(插入代码1) HTML by 0.5 factor(inserted code 2):

      [...] 

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

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

    //插入代码1(〜410行)
    if($ GLOBALS ['section_class'] ==tiki_wiki_page print){
    $ imgdata ['thumb'] ='';
    }
    //插入代码结束1

    //函数调用
    if(!empty($ imgdata ['default'])||!empty $ imgdata ['mandatory'])){

    [...]

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

    //插入代码2(〜410行)
    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 / cssmen .css (或打印模式中包含的其他css)以增加图片说明的底部边距:

        div.thumbcaption {
      margin-bottom:5mm;
      }




    I'm looking for good CMS for publishing software manuals.

    Requirements:

    • publish manual pages as web pages with thumbnails and shows full resolution after click on image,
    • exporting manual pages to a pdf file with full resolution images instead to thumbnails.

    I found IMHO best wiki system named Tiki Wiki (https://info.tiki.org/) but when I export to pdf then I gets low resolution thumbnail.

    解决方案

    I solve this problem by very simple Tiki Wiki code modification:

    Modify lib/wiki-plugins/wikiplugin_img.php to force using full image resolution instead to thumbnail in print page mode (inserted code 1) and rescale images in generated HTML by 0.5 factor (inserted code 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)
    
         }
    
    [...]
    

    Now, after printing to pdf by wkhtmltopdf we gets pdf with small but full resolution images.

    Additional modifies:

    • Adds following lines to cms/cssmenus.css (or other css included in print mode) for increase bottom margin of image caption:

      div.thumbcaption {
          margin-bottom: 5mm;
      }
      

    • Removes lines from 171 to ~175 in templates/tiki-show_content.tpl for remove the "The original document is available at" foot.

    这篇关于CMS和存储高分辨率图像生成的pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆