我正在尝试使用域from fpdf import FPDF
date = input("Type the date (mm/yyy) for your report: ")
while True:
date_event = input("Type the date of the event (dd/mm/yyy): ")
event_description = input("Describe the event: ")
cont = input("To add another event type 1, to generate PDF type 2: ")
if cont == "2":
break
if cont == "1":
continue
pdf = FPDF()
pdf.add_page()
pdf.set_font("Arial", size=16)
pdf.cell(200, 10, txt="Report for " + date, ln=1, align="C")
pdf.set_line_width(1)
pdf.set_draw_color(255, 150, 150)
pdf.line(20, 20, 195, 20)
pdf.set_font("Arial", size=12)
pdf.multi_cell(0, 15, txt=date_event, align="L")
pdf.multi_cell(0, 8, txt=event_description, align="L")
pdf.output("report.pdf")
访问wamp中的Laravel项目。我可以使用lsapp.test
正常访问该网站,但是当我使用上面的内容时,我将被发送到wamp主页。
这是Wamp版本3.1.3,带有Apache 2.4.33,PHP 7.2.4。这是我的httpd-vhosts文件。
localhost/lsapp/public
Windows主机文件:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/lsapp/public/"
ServerName lsapp.test
</VirtualHost>
我搜索了一段时间,但找不到能解决此特定问题的任何东西。
答案 0 :(得分:1)
您还应该将公用路径用作DirectoryRoot。这是格式。
TRect DstRect(X,Y, X+32 + ( 1 - Rotation ) * 32 * Size, Y+32 + Rotation * 32 * Size);
Graphics::TBitmap * Image=new Graphics::TBitmap();
Image->Transparent=true;
//MainForm->Images->GetBitmap(ImgIndex[HisType]+Rotation, Image);
MainForm->Images->Draw(Image->Canvas, 0, 0, ImgIndex[HisType]+Rotation, dsTransparent, itImage);
Canvas->StretchDraw(DstRect, Image);
delete Image;
//MainForm->Images->Draw(Canvas, X, Y, ImgIndex[HisType]+Rotation, dsTransparent, itImage);
编辑:设置虚拟主机后,重启Apache服务器使其生效