Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8844 มุมมอง

Hi all,

i'm wondering if it's possible to generate a PDF document with different page sizes. For example, first page to be a standard A4 document and second page to be a sticker with 30mmx50mm. I've tried with pageSize on template and pageTemplate and it seems that engine creates a second page with the size of A4 but the Canvas size is 30x50. Any idea would be appreciated.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can do that using Aeroo Reports and adjusting page sizes directly on OpenOffice.

Works just as expected!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Should be possible by modifying the custom_rml.xsl file like:

    <xsl:template name="rml">
        <document filename="example.pdf">
            <template>
                <pageTemplate id="sticker" pageSize="(3cm,5cm)" >
                    <frame id="main" x1="0cm" y1="5cm" width="3cm" height="5cm"/>
                </pageTemplate>
                <pageTemplate id="a4_Portrait" pageSize="(21cm,29.7cm)" leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" >
                    <frame id="main" x1="2cm" y1="25cm" width="19.0cm" height="25cm"/>
                </pageTemplate>             
            </template>
...

and then calling the template in your_report.xsl file:

<xsl:template name="story">
     <xsl:attribute name="firstPageTemplate">a4_portrait</xsl:attribute>
</xsl:template>
...
<setNextTemplate>
    <xsl:attribute name="name">sticker</xsl:attribute>
</setNextTemplate>

However, in my case this is working for the Frame setting but not for the pageSize! But according to the RML doc this should work as well for the pageSize setting. What can be wrong?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 18
3833
3
ก.ค. 24
8340
PDF reports แก้ไขแล้ว
5
ก.ค. 25
2200
Wrong PDF Format แก้ไขแล้ว
2
มี.ค. 24
2728
0
พ.ย. 22
2955