小编Iur*_*tup的帖子

文本对齐:对齐;不使用 wkhtmltopdf

再会!

我使用 wkhtmltopdf 库从 HTML 创建 PDF 文档。我根据这个问题使用了svg字体wkhtmltopdf自定义字体字母间距

我使用了自定义字体,由@font-face 添加。对我来说一切都很好,除了一件事: text-align: justify 由于某种原因不起作用。

在 html 中文本按预期对齐,但不是在 PDF 中。

有谁知道如何解决这个问题?

UPD:添加了 CSS 和 HTML 示例

<style type="text/css">
    @font-face{
        font-family:'source_sans_prolight';
        src: url('/font/sourcesanspro-light-webfont.svg') format('svg');
        font-weight:normal;
        font-style:normal;
    }

    @font-face{
        font-family:'Source Sans Regular';
        src: url('/font/sourcesanspro-regular-webfont.svg') format('svg');
        font-weight:normal;
        font-style:normal;
    }
    html, body, p, ul, li, span, img {
        margin: 0px;
        padding: 0px;
    }

    body {
        font-family: "Source Sans Regular", sans-serif;
        text-rendering: geometricPrecision;
    }
    .page {
        width: 729px;
    }
    .block {
        width: 300px;
        float: left; …
Run Code Online (Sandbox Code Playgroud)

html css pdf pdf-generation wkhtmltopdf

7
推荐指数
2
解决办法
5699
查看次数

如何使用 AWS Glue 在 dynamo 中写入字符串集?

我需要将数据从一个发电机表复制到另一个发电机表,并在此过程中进行一些转换。为此,我将数据从源表导出到 s3 并对其运行爬虫。在我的 Glue Job 中,我使用以下代码:

mapped = apply_mapping.ApplyMapping.apply(
    frame=source_df,
    mappings=[
        ("item.uuid.S", "string", "uuid", "string"),
        ("item.options.SS", "set", "options", "set"),
        ("item.updatedAt.S", "string", "updatedAt", "string"),
        ("item.createdAt.S", "string", "createdAt", "string")
    ],
    transformation_ctx='mapped'
)
df = mapped.toDF() //convert to spark df
// apply some transformation
target_df = DynamicFrame.fromDF(df, glue_context, 'target_df') //convert to dynamic frame
glue_context.write_dynamic_frame_from_options(
    frame=target_df,
    connection_type="dynamodb",
    connection_options={
        "dynamodb.region": "eu-west-1",
        "dynamodb.output.tableName": "my-table",
        "dynamodb.throughput.write.percent": "1.0"
    }
)
Run Code Online (Sandbox Code Playgroud)

在源 dynamo 表中,该options字段是一个字符串集。在转变过程中,它保持不变。但是,目标表中有一个字符串列表:

"options": {
    "L": [
      {
        "S": "option A"
      },
      {
        "S": "option B" …
Run Code Online (Sandbox Code Playgroud)

python amazon-web-services amazon-dynamodb aws-glue

6
推荐指数
1
解决办法
2154
查看次数