Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't print any custom print format as PDF in v15 #41397

Open
Islamation opened this issue May 9, 2024 · 3 comments
Open

Can't print any custom print format as PDF in v15 #41397

Islamation opened this issue May 9, 2024 · 3 comments
Labels

Comments

@Islamation
Copy link

Information about bug

Hello guys,
While I'm printing more than one material request, the system opens a blank PDF
although I was printing with the same print format as pdf in v14
FYI
The print format is customed not standard

Thanks for you all

Module

buying, other

Version

ERPNext: v15.22
Frappe: v15.25

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

No response

@Islamation Islamation added the bug label May 9, 2024
@Nihantra-Patel
Copy link
Contributor

If the standard print format is working, there must be some problem in the custom format's code itself.

We tested in v15 latest with custom print format, but there is no issue found. Please share the code.

@Islamation
Copy link
Author

`<style>

/* arabic /
@font-face {
font-family: 'Cairo';
font-style: normal;
font-weight: 600;
src: url(https://fonts.gstatic.com/s/cairo/v10/SLXLc1nY6Hkvalr-ao6O59ZMaA.woff2) format('woff2');
unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
/
latin-ext /
@font-face {
font-family: 'Cairo';
font-style: normal;
font-weight: 600;
src: url(https://fonts.gstatic.com/s/cairo/v10/SLXLc1nY6Hkvalr-ao6F59ZMaA.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/
latin */
@font-face {
font-family: 'Cairo';
font-style: normal;
font-weight: 600;
src: url(https://fonts.gstatic.com/s/cairo/v10/SLXLc1nY6Hkvalr-ao6L59Y.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.print-format table, .print-format tr,
.print-format td, .print-format div, .print-format p {
font-family: 'Cairo';
line-height: 90%;
vertical-align: middle;

}
@media print {
body{
     font-family: 'Cairo';
    width: 220mm;
    height: 300mm;
    margin: 5mm 5mm 10mm 5mm; 
    /* change the margins as you want them to be. */

}
}
@media screen {
.print-format {
width: 200mm;
padding: 5mm;
min-height: 300mm;
footer {page-break-after: always;}
}
}
table.no-border, table.no-border td{

margin-top: -20px !important;

}

.table .table-condensed .table-hover .table-bordered .print-format td, .print-format th{
background-color: whitesmoke !important;
}
.print-format td, .print-format th {

}

.print-heading {

float: left !important;

border-bottom: 1px solid #d1d8dd !important;
width: 45% !important ;
}

.alert-logo {
padding: 0px !important;
margin-bottom: .5px !important;
border: 0px solid transparent !important;
border-radius: 4px !important;
text-align: left !important;
color: red !important;
}

.cr{
width: 60% !important;
margin-top: -5px !important;
display: block;
margin-left: auto;
margin-right: auto;

}
.logo-div1{

text-align: right !important;
width: 40% !important;

margin-right: 160px !important;  
}

.logo-div2 {
font-family: Arial !important;
color: darkblue !important;
text-align:center !important;
font-size:18px !important;
}
.logo-div3 {
font-family: 'Cairo';
font-weight:700 !important;
color: darkblue !important;
font-size:14px !important;
margin-top:5px;
margin-bottom: -29px !important;
margin-left: 5px !important;
}

.logo-div4{
font-family: Arial !important;
color: darkblue !important;
font-size:14px !important;
margin-bottom: -32px !important;
margin-top: -50px !important;
}
.logo-div8{
font-family: Arial !important;
color: darkblue !important;
font-size:14px !important;
margin-bottom: -15px !important;
margin-top: -38px !important;
}

.logo-div5{

    width: 35% !important;
    margin-top: 15px !important;
   display: block;
   margin-left: auto;
   margin-right: auto;
}

.logo-div6{
text-align:center !important;
margin-top: 3px !important;
font-family: Arial !important;
color: darkblue !important;

text-align:center !important;
font-size:14px !important;
}
.logo-div7{

    width: 65% !important;
    max-height: 45px !important;
    margin-top: 19px !important;
   display: block;
   margin-left: auto;
   margin-right: auto;
}

.table-bordered, .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
border: 0.5px solid #d1d8dd !important;
}

.td1 {

border-bottom: 0.5px solid #d1d8dd !important;
}

.si {

color: darkblue !important;
margin-top: -5px !important; 

}

.table-no-b {

border-top: 0 !important;
margin-top: -5px !important;
}

.space {

margin-top: -12px !important;

}

.ql-editor.read-mode {

padding:6px !important ;
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {

font-weight: 600 !important;

}

.w1 {
margin-right: 115px !important;
}
.w2 {
border-top: 3px solid #d1d8dd !important;
padding-top: 10px !important;
}

</style>

{{ doc.company }}

{{ "الشركة المتحدة للبطاريات السائلة" }}
{{ _("رقم السجل التجاري : 655 ") }}
{{ _("رقم البطاقة الضريبية : 481688080 ") }}
{{ letter_head }}



{{ _("الغرض ") }}: {{ _(doc.material_request_type ) }}

{{ _("الحالة ") }}: {{ _(doc.status ) }}

</td>
<td style="width: 50%;">
{{ _(" طلب مواد ") }}

</tbody>
{{ _(" رقم المستند ") }} : {{ doc.name}}
{{ _(" تاريخ المستند ") }} : {{ doc.get_formatted("transaction_date", doc) }}
</td>

{{ _("Service & product information") }}


 </tr> 
        </tr>
        {%- for row in doc.items -%}
        <tr>
            
           <td style="width: 3%;">{{ row.idx }}</td>
           <td style="width: 22%;">{{ row.item_code }}</td>
	<td style="width: 30%;">{{ row.custom_item_name_in_arabic }}</td>
		<td style="width: 15%; text-align: center;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
		
	</tr>
	{%- endfor -%}
	
		<tr>
	<th style="color:darkblue; text-align: right;border: whitesmoke !important; "></th>
	<!-- get grand total //-->
	<th style="text-align: center;border: whitesmoke !important;"></th>
		<th style="color:darkblue; text-align: left; border-right: whitesmoke !important; "> الاجماليات : </th>
	<th style="text-align: center;">{{ doc.items|sum(attribute= 'qty') }}</th>

</tr>
</tbody>
م كود الصنف اسم الصنف كمية



{%- if doc.terms -%}

{{ _("الملاحظات و الشروط و الاحكام") }}


 </tr> 

{{ doc.terms or "" }}

        </tr>
       </td>
</tbody>

{%- endif -%}

`

@Nihantra-Patel
Copy link
Contributor

Please provide the code in the below style. and your code shows a mismatch.

image

And code is long, so you have to test it yourself one by one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants