如何将徽标和左右两个段落对齐到reportlab

问题描述

我想在左侧设置徽标,并在同一行中上下拖动段落。怎么做。 下面是我的示例代码

import reportlab
from reportlab.lib.pagesizes import A4
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.utils import ImageReader
from reportlab.platypus import SimpleDocTemplate,TableStyle,Paragraph,Image,Spacer,Frame,Paragraph
from reportlab.platypus.tables import Table
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet,ParagraphStyle
from reportlab.lib.enums import TA_JUSTIFY,TA_LEFT,TA_CENTER,TA_RIGHT
from reportlab.lib.colors import red,black,navy,white,green,maroon

styles = getSampleStyleSheet()
style_right = ParagraphStyle(name='right',parent=styles['normal'],alignment=TA_RIGHT,textColor=maroon,fontName='Helvetica-Bold')
style_right1 = ParagraphStyle(name='right',alignment=TA_RIGHT)

width,height = A4
logo = 'logo.jpg'

document = []

imgw = imgh = 80
im = (Image(logo,width=imgw,height=imgh))
im.hAlign = 'LEFT'

tbl_data = [[(im)],[Paragraph(" My Company",style_right )],[Paragraph("rightright rightright rightright rightright,rightright,<br/>  rightright rightright rightright rightright,rightright",style_right1)]
            ]

tbl = Table(tbl_data,repeatRows=1)
    
document.append(tbl)

doc = SimpleDocTemplate('uni.pdf',pagesize=A4,rightMargin=10,leftMargin=10,\
    topMargin=10,bottomMargin=10,allowSplitting=1)
doc.build(document)

我正在获取以下PDF。根据我的要求怎么做。如何删除上方空白或将两个段落向上移动。

Please Click this to find the referring image

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)