在我的 html 中使用此内容,页脚将不会在 pdf 中呈现...
<!DOCTYPE html>
<html>
<head>
<style>
footer{
background:#ccc;
position:absolute;
bottom:0;
width:100%;
padding-top:50px;
}
</style>
</head>
<body>
<footer>
<p> test </p>
<p> test </p>
<p> test </p>
<p> test </p>
<p> test </p>
<p> test </p>
<p> test </p>
<p> test </p>
<p> test </p>
</footer>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
当未指定位置时它会起作用...
为了生成 pdf,我使用 pdfkit 和 python:
pdfkit.from_file(content_url, 'out.pdf', {
'--footer-html': footer_url,
'--footer-spacing': '10'
})
Run Code Online (Sandbox Code Playgroud)
这是我在 content_url 中使用的内容
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p> content </p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
有什么帮助吗?
我对 SQLAlchemy 自动映射和覆盖名称有一个大问题。请参阅下面的代码:
from sqlalchemy import create_engine, text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.automap import automap_base
import re
import inflect
import warnings
from sqlalchemy import inspect
#name overriding
def name_for_scalar_relationship(base, local_cls, referred_cls, constraint):
name = referred_cls.__name__.lower()
local_table = local_cls.__table__
if name in local_table.columns:
newname = name + "_"
warnings.warn(
"Already detected name %s present. using %s" %
(name, newname))
return newname
return name
def camelize_classname(base, tablename, table):
"Produce a 'camelized' class name, e.g. "
"'words_and_underscores' …Run Code Online (Sandbox Code Playgroud)