äžè¬çãªã±ãŒã¹ã§ã¯ãããã¯Djangoã§ãããã§ã¯ãªãããã³ãã¬ãŒããšã³ãžã³ã䜿çšããŠPythonããèŠå¶ãããããã¥ã¡ã³ããå°å·ããããšã§ãã
ããã«æ ãèªãããã«-ç§ã¯ããã«èšããŸã-åé¡ã¯å®å šã«è§£æ±ºãããŠããŸããã ããããå€ããå°ãªããæ©èœããããŒãžã§ã³ãç»å ŽããŸããã
1.課é¡
- ãŠãŒã¶ãŒãããŒã¿ãWebãã©ãŒã ã«å ¥åããŸã
- ãµãŒããŒã¯ãã®ããŒã¿ãå°å·å¯èœãªãã³ãã¬ãŒãã«æ¿å ¥ããŸãã
- ãããŠãå°å·å¯èœãªåœ¢åŒã§ãŠãŒã¶ãŒãæäŸããŸã
2.å¶é
- ãã©ãŒã ã¯ããœãããïŒç²ŸåºŠãããã»ã©éèŠã§ã¯ãªãå Žå-å¥çŽãã¢ã«ãŠã³ããªã©ïŒããã³ãããŒããïŒç²ŸåºŠ-ã¹ãã£ããŒã®å Žåã¯æ倧-移æ°éç¥ãŸãã¯STSãžã®ç³è«ïŒãã©ãŒã 26.2-1ïŒïŒã«ããããšãã§ããŸãã
- ããã«ãããœããããã©ãŒã ã§ãããäœæè ã®èšç»ã«ã§ããã ãè¿ãå Žæã§å°å·ããå¿ èŠãããïŒå¢çã1 cmã§ãããšèšã£ãå ŽåããŠãŒã¶ãŒã¯æ£ç¢ºã«1 cmã®å¢çãæã€ããã¥ã¡ã³ããååŸããå¿ èŠããããŸãïŒãç¹ã«æ¹ããŒãžãèæ ®ããŸãïŒãã©ãŒã 11001ã21001ãªã©ãåç §ããŠãã ããïŒ .dãïŒã
- å¿ é -ãœãŒã¹çŽ æãå€æããããã®æå°éã®åãïŒååãšããŠ-.xlsãŸãã¯.docããConsultantããŸãã¯ãGuarantorãããã·ãŒã ã¬ã¹ïŒã
- ãªããªã Webã¢ããªã±ãŒã·ã§ã³ã«ã€ããŠè©±ããŠãã-ãœãªã¥ãŒã·ã§ã³ã®å¿çæ§ãšä¿¡é Œæ§ãéåžžã«æãŸãã=>ãã€ãã£ãã®Pythonã©ã€ãã©ãªã䜿çšããããšãéåžžã«æãŸããã
- ãã®ãã¡ãŒã å šäœãã¬ã³ã¿ã«ãã¹ãã£ã³ã°ïŒçæ³çã«ã¯GAEïŒã«é 眮ããããšãæãŸããã§ãã
- ãã³ãã¬ãŒããèŠèŠçã«ç·šéã§ããããšãæãŸããã§ãã
- ãã³ãã¬ãŒãã®ã¯ã€ãã¯ãã¬ãã¥ãŒïŒããã³ããã«è¯ãçµæïŒãæãŸããã§ãã
æåã®æ®µéã¯ãæçµåœ¢åŒã®éžæã§ãã ããŸããŸãªt.zã§ã®çèã®åŸã ïŒã¯ãã¹ãã©ãããã©ãŒã ãä¿èšŒãããçµæãå€æå¯èœæ§cïŒéžæã¯PDFã§æ±ºãŸããŸããã
ä»-å ¥å圢åŒãšãã®å€ææ¹æ³ã
3.ãœãããã©ãŒã
ODF
ç§ãã¡ã¯ãOpen Document Format-ODSãODTãªã©ã«ã€ããŠè©±ããŠããã
ããã§ã¯ãã¹ãŠãéåžžã«ç°¡åã§ãã
- LibreOfficeã§ãã³ãã¬ãŒããç·šéããŸãïŒããŒã¿çšã®ã¹ããŒã¹ãæ®ããŸãïŒã
- ã©ãããããããDjangoã®ãã£ãŒã«ãã«å ¥åããŸãã
- ã©ããããããPDFãååŸ
ããŒã¿ã®å ŽæïŒãŠãŒã¶ãŒå®çŸ©ãã£ãŒã«ããããã¥ã¡ã³ãã«è¿œå ãããã{{django tags}}ãããã¹ãã«çŽæ¥æ¿å ¥ããŸãã æåã®ã±ãŒã¹ã§ã¯ããããã®ãã£ãŒã«ãã«åŸã§pythonããå ¥åããããšã¯ããããå¯èœã§ãããã©ã®ããã«æ³åããããšãã§ããŸããïŒããæ£ç¢ºã«ã¯ã衚瀺ããããã®ã¯ãã¹ãŠéåžžã«çŽããããããã§ãïŒ ãããã£ãŠãã¿ã°ã¯ããã¹ã圢åŒã§é 眮ããã ãã§ãã
ãã®å Žåããã£ãŒã«ãã®å ¥åã¯åºæ¬ã§ã-ãã³ãã¬ãŒããDjangoãã³ãã¬ãŒããšã³ãžã³ã«ãã£ãŒãããã ãã§ãïŒgentushkiã®ãã³ãã¬ãŒãå ã§éžæããããã«Pythonã©ã€ãã©ãªãæ®ããŸã:-)ã ãããŠãããã¯ããšã«ããã¥ã¡ã³ãã解å/å§çž®ããªãããã«ãããã¥ã¡ã³ãã¯* .fodXïŒãã©ããXïŒã«ä¿åãããŸã-å¯äžã®è§£åãããxmlã ãã³ãã¬ãŒãã¯xmlãšããŠäŸçµŠãããŸãã
PDFã®ååŸ-ãªãã·ã§ã³ãªã-LibreOfficeã®äœ¿çšïŒLibreOfficeããŒã¢ã³ïŒlibreofficedïŒubuntudersã®ã©ããã«ãããŸãïŒïŒãŸãã¯unoconvããã£ãŒãããããããŒã¢ã³ã¢ãŒãã§LOã©ã³ãã£ãŒãæåã§å®è¡ããŸãã ãããã®ãªãã·ã§ã³ã¯ãã¹ãŠã»ãŒåãã§ãã
é·æ
- ã€ã³ã¿ãŒãããã§æãããããã¥ã¡ã³ããããã«äœ¿çšã§ããŸãïŒéåžžã¯Microsoft Office圢åŒã®ãã³ã³ãµã«ã¿ã³ããããïŒã
- ç·šéãã³ãã¬ãŒãã§-åé¡ãããŸããã
- ãã¬ãã¥ãŒãšåæ§ã
- ãããã-Googleããã¥ã¡ã³ãã«é¢ããPDFãååŸããŠããŸã-ãŸã è©ŠããŠããŸããã ããããããããªã¢ã¯ãã£ãã«ãªãããšã¯çããŸããïŒééã£ãŠããããšã¯çããŸãããgoogledoxã®ã³ã³ãµã«ã¿ã³ãããåããã©ãŒã 21001ãããŠã³ããŒãããŠã¿ãŠãã ããïŒçšåWebãµã€ãã«ãããŸãïŒïŒã
æ¬ ç¹
- ãã³ãã¬ãŒããèšè¿°ãããšãã«ãLibreOfficeãèªçºçã«ã¿ã°ãç Žå£ããããããçš®é¡ã®span lang = "en-GB"ãªã©ã{{..}}å ã«æ¿å ¥ããŸãã 次ã«ããã¹ãŠãæåã§æ»ãå¿ èŠããããŸãã
- ãµãŒããŒã®çŽ æŽããããªãœãŒã¹æ¶è²»-100ïŒ CPUïŒæ°ã«é¢ä¿ãªã1ã€ã®ã¿ïŒãæ°çŸã¡ãŒãã«ã®RAMãPDFãåä¿¡-æ倧1ååŸïŒãã©ãŒã 21001-P4-3.0ã§50ç§ïŒã Javaãåãã§ãã
- å€ãã®ããã±ãŒãžïŒFedoraãCentOSïŒããã«ããŸãã
- å°ãªããšãããã€ãã®XãµãŒããŒïŒããšãã°ãXvfbïŒã®ååšã
- ããããã圌ãã¯ããã€ãã®ãã¹ãã£ã³ã°ã§LibreOfficeãå±éããããšãèš±å¯ãããã§ããã-ããããç§ã¯äŸãã°nic.ruã匷ãçããŸãã GAEã«ã€ããŠã話ããŠããŸããã
- çµæã®ãã¬ãã¥ãŒã¯ãããŸããã
ãŸãšã
極端ãªãã©ãŒã«ããã¯ãªãã·ã§ã³ãšããŠ-é©åã ããããåãããã極端ã§ãã
HTML
ããã§ã¯ããã³ãã¬ãŒãã®ç·šéïŒæäœæ¥ïŒãšãã³ãã¬ãŒããšã³ãžã³ïŒã¹ããŒã¯ïŒã«ããããã¹ãŠãæ確ã«ãªããŸãã å°ããã§ãããäž»ãªè³ªåã1ã€ãããŸã-PDFãååŸããæ¹æ³ã§ããïŒ å¿ èŠã«å¿ããŠæ¹ããŒãžã䜿çšããŠããã°ããå¹ççã«ã ãããŠããããæãå®éšçã§ããã
çŽç²ãªpython htmlã¬ã³ããªã³ã°ïŒPISAãç¥å /çžç¶äºº/ãã©ãŒã¯ãªã©ïŒã䜿çšããå€æ°ã®å®éšã«ãããéèŠãªïŒIMHOïŒçµè«ãå°ãåºãããŸãããçµæãä¿èšŒããã«ã¯ãæ¢è£œã®htmlãšã³ãžã³ã䜿çšããå¿ èŠããããŸãã ãã®ãã¡ãç§ãã¡çãç¥ã£ãŠããããã«ãæ倧ââ4ïŒéåžžããïŒã ãããã®ãã¡ãLinuxã§ã¯geckoãšwebkitã®2ã€ãŸã§äœ¿çšã§ããŸãã PythonããgeckoãåŒã³åºãããšã¯ã»ãšãã©å¯èœã§ãããaïŒXãå®è¡ããå¿ èŠããããŸãïŒLibreOfficeã®å Žåã®ããã«ïŒbïŒæ¢è£œã®ã¬ã·ããèŠã€ãããŸããã§ããã
æ®ãã®WebkitïŒ
- PyQt4> Qt> WebKit> QPrinterïŒãã®ãããªïŒã ãã€ãã£ãïŒå€ãã®æ©èœãåããŠããŸããïŒè³¢ã-ããããæ¹ããŒãžã¯ãã£ããããŸããã ããã«ãDPIãšZoomFactorã䜿çšããç¹å¥ãªãã³ã¹ãå¿ èŠã§ãã
- GTK> WebKit> GTKããªã³ã¿ãŒïŒãã®ãããªïŒã ãã€ãã£ãã§ãè³¢ã-ããããæ¹ããŒãžããã£ããããŸããã
- ç¹å¥ã«å€æŽãããwebkit- wkhtmltopdf-ãå€éšãã€ããªã®åœ¢åŒïŒçŸåšã¯ãã®ãªãã·ã§ã³ã䜿çšïŒã§äœ¿çšãããããã€ãã£ãã®Pythonãã€ã³ãã£ã³ã° ïŒåŠçäžã§ãããå°ããªåé¡ããããŸãïŒã䜿çšããŸãã ãã€ãã£ãïŒãã€ã³ãã£ã³ã°ã®å ŽåïŒãã¹ããŒãã«æ¹ããŒãžããã£ããããçµæãä¿èšŒãããŸãã
é·æ
- çè«çã«ã¯ ãèŠèŠçãªç·šéãå¯èœã§ãã
- ã€ã³ã¹ã¿ã³ããã¬ãã¥ãŒïŒåãHTML圢åŒïŒ-ãã³ãã¬ãŒããšããŠ-çµæ
- PDFãžã®ãªã¢ã¯ãã£ãå€æã
- PDFã«å€æããçŽç²ãªpython APIïŒãé²è¡äžãïŒã
æ¬ ç¹
- ããã§ããé«å質ã®HTMLã¯æäœãã§ãã
- è€éãªãã©ãŒã ïŒ21001ãªã©ïŒã¯ãç¬èªã«äœæãŸãã¯æç»ããå¿ èŠããããŸããããã¯ãã€ã³ã¿ãŒãããäžã§ã¯æã.xlsã§ããããã§ãã
- ãªããªã Linuxçšã«æ§ç¯ãããlib /ãã€ããªã䜿çšãã-åãnic.ruïŒFreeBSDïŒã§ã¯ãäœãæ©èœããŸããïŒæŸèæãªãïŒã GAEã¯ãŸã åé¡å€ã§ãã
ãŸãšã
ããœãããããã¥ã¡ã³ãã®äž»ãªãªãã·ã§ã³ã ãããã é«å質ã®çŽç²ãªpython htmlã¬ã³ããŒïŒãã©ãã·ã¥ãJSããã®ä»ã®æŒ«ç»ãªãïŒãæ¢ãå¿ èŠããããŸãããé«å質ã®CSSåŠçãå¿ èŠã§ãã
ãã¶ã
å°æ¥çã«ã¯ãTeXãLaTeXãLyxãdocbook圢åŒãèæ ®ãããŸããããããŸã§ã®ãšããå©ç¹ã¯ãããŸããïŒç¹ã«ãã»ãŒãœãããªã圢åŒã®å Žå-åã21001ãªã©ïŒã
4.ããŒããã©ãŒã
ããã§ã¯ãã¹ãŠãæ²ããã ç¹ã«ãããã§ã¯æ¢ã«ããžã¥ã¢ã«ãšãã£ã¿ãéåžžã«æãŸãããšããäºå®ã«ç §ãããŠã
ããã«ããã·ã¢é£éŠã®ãããŒãããã©ãŒã ã®å€§éšåïŒãã¹ãŠã§ã¯ãªãã«ããŠãïŒã§ã¯ãããã¹ããæåã«åå²ããããšãã«ãæ£æ¹åœ¢ãã䜿çšããããããããç¬èªã®æ£æ¹åœ¢ã«åãŸããŸãïŒ äŸ ïŒã
æåã®ãã®ïŒãtiffã®ãã«ããã¹ãããªã©ïŒãåé€ãããã¡ã€ããªã¹ãã«çŽè¡ããŸãã
RML
Reportlabã®éçºïŒã¯ããpython-reportlabã¯åœŒãã®ãã®ã§ãïŒã¯éåžžã®XMLã§ãããPDFã§äžæè°ãªä»äºãããããšãã§ããŸãã ãªããªã ããç¥ãããŠããpython-trml2pdfã¯ãã§ã«RIPã§ãïŒéçºè ãæ£çŽã«ç§ã«æžããããã«ïŒ-ãã®trml2pdfãåããå°ãä»äžããªããã°ãªããŸããã§ããã RMLã®å€ãã®èå³æ·±ãæ©èœããµããŒãããŠãããã å®æã«ããåçšã®rml2pdfãè³Œå ¥ããããšã¯çŠããããŠããŸãïŒããã«å£ããŠããŸãïŒã
é·æ
- ãã€ãã£ã
- è³¢ã
- æè»ã«
- ãã¹ãã£ã³ã°ã«åé¡ã¯ãªãã¯ãã§ãïŒçè«çã«ïŒ-GAEã§ãïŒè©Šããããšã¯ãããŸããïŒã
æ¬ ç¹
- å³å¯ã«æäœã
- éåžžã«ããªãããŒãªæ§æã¯ãæ£ç¢ºãªé 眮ïŒãã°ã©ãã£ãã¯ãïŒãšããœãããããã¹ãïŒããããŒã©ãã«ãïŒãæ··åšãããå¿ èŠãããå Žåã§ãïŒãããã£ãŠãããžã¥ã¢ã«ãšãã£ã¿ãŒããªãããã§ãïŒã
- ãã¬ãã¥ãŒãªã-ãã³ãã¬ãŒããçµæããããŸããã
ãŸãšã
æ£ç¢ºãªåœ¢åŒïŒç¹ã«åçŽãªåœ¢åŒïŒã®ãã©ãŒã«ããã¯ã
PDFãã©ãŒã
ããã§ã¯ãã¹ãŠãéåžžã«ç°¡åã§ããPDFã®ãœãŒã¹-PDFã®æçµçµæã§ãã
- å·Šæã«å ã®PDFãåããŸã
- çµã¿èŸŒã¿ã®Djangoãã³ãã¬ãŒããšã³ãžã³ã«ãã£ãŠåŠçãããXFDFïŒæ°åããªãxmlïŒ-å³åŽ
- ããããæ°ããPDFã«ããŒãžïŒåã蟌ã¿ïŒïŒãããŒã«ã¢ãŠãã-ãã©ããåïŒ
- ããããŠãŒã¶ãŒã«æž¡ããŸã
åé¡ã¯1ã€ã ãã§ã-é ç®3ã
ãããŸã§ãPDFãã©ãŒã ãæäœããããã®ãã€ãã£ãã§æ£ããæ©èœããpython APIã¯èŠã€ãããŸããã§ããïŒãã ããpopplerã¯æ¢ã«äœããå®è¡ã§ããŸãããæããã«ãããã«å€ãã®æ©èœããããŸãïŒããããã£ãŠã iTextãå¯äžã®èš±å®¹å¯èœãªãªãã·ã§ã³ã§ãã pdftkãŸãã¯èªè»¢è»ã䜿çšããããšã¯ããã§ã«ããªãã®å¥œã¿ã«åã£ãŠããŸãã
é·æ
- äœã§ãPDFãã©ãŒã ã«å€æã§ããŸãïŒå¥ã®åé¡ãšããŠïŒã
- ïŒåæ§ã«ïŒç·šéããããšãã§ããŸãã
- 絶察ã«ä¿èšŒãããçµæã
- çµã¿èŸŒã¿ã®PDF圢åŒãæ£æ¹åœ¢ãïŒã³ã³ãïŒã
- ã»ãšãã©ã®å Žå-ãã¹ãã£ã³ã°ã«åé¡ã¯ãããŸããïŒãããã-ããã³GAEã«ïŒ-ç§ã¯è©ŠããŠããŸããã
æ¬ ç¹
- Python APIã®ä»£ããã«å€éšã¢ããªã±ãŒã·ã§ã³ãåŒã³åºããŸãã
- Javaãåãã§ãã
ãŸãšã
æ£ç¢ºãªå°å·ãã©ãŒã ã®äž»ãªãªãã·ã§ã³ã
5.æŠèŠ
ä»æ¥åœ¢æãããåèšïŒ
- ããœããããã©ãŒã -html | webkit-ããããããªãéããåé·ã§ãããŸãããŒã¿ãã«ã§ã¯ãªãwebkittoxã©ã€ãã©ãªã䜿çšããŸãïŒãããŠèŠç¶ããŸãïŒã
- ãããŒãããã©ãŒã ã¯PDFãã©ãŒã ã§ããã
æŸèæãä»ããŠå€éšJAVAã©ã€ãã©ãªã䜿çšããŸãïŒããã©ãã¬ã€ããç¶ããŸãïŒã - ODFããã³RML-ãããããã©ãŒã«ããã¯ãªãã·ã§ã³ãšããŠã
PSã ãããã©ã®ããã«æ©èœããã- ããã§èŠãããšãã§ããŸã-ODFãšRMLãªãã§ãåŸè ãæäŸãããŸãã