view · edit · sidebar · attach · print · history

20120706-docx-parser-image-support-in-table

<< | Index | >>


Summary

  • Updated ydocx to parse images in table.(stand alone image)
  • Updated swissmedic number handling of fachinfo

Commits

Index


Update ydocx for image support in table

<w:p>
  <w:pPr>
    <w:pStyle w:val="style0"/>
    <w:autoSpaceDE w:val="false"/>
    <w:snapToGrid w:val="false"/>
    <w:spacing w:line="360" w:lineRule="atLeast"/>
  </w:pPr>
  <w:r>
    <w:rPr>
      <w:sz w:val="22"/>
      <w:szCs w:val="22"/>
      <w:rFonts w:ascii="Arial" w:cs="Arial" w:hAnsi="Arial"/>
    </w:rPr>
    <w:drawing>
      <wp:inline distB="0" distL="0" distR="0" distT="0">
        <wp:extent cx="923290" cy="913765"/>
        <wp:effectExtent b="0" l="0" r="0" t="0"/>
        <wp:docPr descr="A description..." id="1" name="Picture"/>
        <wp:cNvGraphicFramePr>
          <a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/>
        </wp:cNvGraphicFramePr>
        <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
          <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
            <pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
              <pic:nvPicPr>
                <pic:cNvPr descr="A description..." id="0" name="Picture"/>
                <pic:cNvPicPr>
                  <a:picLocks noChangeArrowheads="1" noChangeAspect="1"/>
                </pic:cNvPicPr>
              </pic:nvPicPr>
              <pic:blipFill>
                <a:blip r:embed="rId4"/>
                <a:srcRect/>
                <a:stretch>
                  <a:fillRect/>
                </a:stretch>
              </pic:blipFill>
              <pic:spPr bwMode="auto">
                <a:xfrm>
                  <a:off x="0" y="0"/>
                  <a:ext cx="923290" cy="913765"/>
                </a:xfrm>
                <a:prstGeom prst="rect">
                  <a:avLst/>
                </a:prstGeom>
                <a:noFill/>
                <a:ln w="9525">
                  <a:noFill/>
                  <a:miter lim="800000"/>
                  <a:headEnd/>
                  <a:tailEnd/>
                </a:ln>
              </pic:spPr>
            </pic:pic>
          </a:graphicData>
        </a:graphic>
      </wp:inline>
    </w:drawing>
  </w:r>
</w:p>

Added support for stand alone image parsing(without anthor, wrap text)

commit

Improved swissmedic number parsing

For following format swissmedic number(use first one, as output directory name)

Zulassungsnummern

62069, 61848 (Swissmedic).
commit

Update fiparsed

create parse_fachinfo_docx

in src/state/registration.rb

  def parse_fachinfo(type, file)
    begin
      # establish connection to fachinfo_parser
      parser = DRbObject.new(nil, FIPARSE_URI)
      if type == :doc
        result = parser.send("parse_fachinfo_doc", file)
      else
        result = parser.send("parse_fachinfo_#{type}", file.read)
      end 
      result
    rescue ArgumentError => e
      msg = @session.lookandfeel.lookup(:e_not_a_wordfile)
      err = create_error(:e_pdf_not_parsed, :fachinfo_upload, msg)
      @errors.store(:fachinfo_upload, err)
    rescue StandardError => e
      msg = ' (' << e.message << ')' 
      err = create_error(:e_pdf_not_parsed, :fachinfo_upload, msg)
      @errors.store(:fachinfo_upload, err)
      e   
    end 
  end
Statistics
  1. 1.Parse docx file as HTML with ydocx (needs replace path of img tag)
  2. 2.Parse html file as ODDB::Object
view · edit · sidebar · attach · print · history
Page last modified on July 06, 2012, at 11:32 AM