You need to sign in to do that
Don't have an account?
Joaquin Iudica
PDF generation failed. Check the page markup is valid for pdf vf
Hi, I'm sorry for posting this question without understanding the problem, but someone made changes to this pdf visualforce component and now it is throwing a markup error which i can't find , and SF doesn't specify this kind of errors. Any ideas why this is failing? Thanks a lot.
Visualforce page:
Visualforce component:
Visualforce page:
<apex:page renderAs="pdf" controller="PrintSalesElectronicInvoiceExpController" sidebar="false" showHeader="false" standardStylesheets="false" showChat="false" applyBodyTag="false" applyHtmlTag="false" cache="false" language="{!language}"> <head> <style type="text/css"> @page { margin-top: 350px; margin-left: 10px; margin-right: 10px; margin-bottom: 105px; @top-center { content: element(header); } @bottom-center { content: element(footer); } } div.header { display: block; margin-top: 10px; margin-left:10px; position: running(header); font-family:arial,sans-serif; } div.footer { margin-left:10px; display: block; position: running(footer); font-family:arial,sans-serif; } .divPage { display: block; page-break-after: always; margin-top: 0px; /**height:350px;**/ } .lastPage { display: block; margin-top: 0px; /*height:405px;*/ } .report{ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; -o-box-sizing: border-box; box-sizing: border-box; width:100%; font-family:arial,sans-serif; margin-left:5px; } .vistaPrevia{ text-align: center; width:100%; align-content: center; } </style> </head> <c:printSalesElectronicInvoiceExpCmp object_Id="{!objectId}" /> </apex:page>
Visualforce component:
<apex:component controller="PrintSalesElectronicInvoiceExpController" access="global" > <apex:attribute name="object_Id" type="String" required="required" assignTo="{!objectId}" description="ID del pedido remito factura"/> <div class="report"> <div class="header"> <table border="0" cellspacing="0" cellspading="0" style="font-size:14px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;" width="100%"> <tr> <td width="50%" style="padding-left:20px;font-size:11px;"> <table width="100%" border="0" cellspacing="0" cellspading="0"> <tr> <td style="font-size:20px;"><apex:image url="{!datosEmpresa.URL_logo__c}" rendered="{!!isVistaPrevia}"/></td> </tr> <tr> <td><b>{!$Label.printSalesElectronicInvoiceExp_1}: {!datosEmpresa.ERPvs__Denominacion_o_Razon_Social__c}</b></td> </tr> <tr> <td>{!$Label.printSalesElectronicInvoiceExp_2}: <apex:outputText value="{!wHeaderFooter.domicilioHeader}"/> - <apex:outputText value="{!wHeaderFooter.codigoPostalHeader}"/>, <apex:outputText value="{!wHeaderFooter.localidadHeader}"/>, <apex:outputText value="{!wHeaderFooter.provinciaHeader}"/>, <apex:outputText value="{!wHeaderFooter.paisHeader}"/></td> </tr> <tr> <td>{!$Label.printSalesElectronicInvoiceExp_3} <apex:outputText value="{!wHeaderFooter.telHeader}"/> </td> </tr> <tr> <td><b>{!$Label.printSalesElectronicInvoiceExp_4}: IVA Responsable Inscripto</b></td> </tr> </table> </td> <td width="10%" style="vertical-align: text-top;"> <table border="0" cellspacing="0" cellspading="0"> <tr> <td style="font-size:40px;"><b><apex:outputText value="{!wHeaderFooter.letra}"/></b></td> </tr> <tr> <td style="font-size:11px;"><b>{!$Label.printSalesElectronicInvoiceExp_5}{!wHeaderFooter.codigoLetra}</b></td> </tr> </table> </td> <td width="40%"> <table border="0" cellspacing="0" cellspading="0" width="100%"> <tr> <td style="font-size:12px;" colspan="2"> <b> <apex:outputText rendered="{!wHeaderFooter.cv.Codigo_afip__c == 19 && TCVNombrePDF == ''}">{!$Label.erpvs__printsaleselectronicinvoiceexp_6}</apex:outputText> <apex:outputText rendered="{!wHeaderFooter.cv.Codigo_afip__c == 21 && TCVNombrePDF == ''}">{!$Label.erpvs__printsaleselectronicinvoiceexp_7}</apex:outputText> <apex:outputText rendered="{!wHeaderFooter.cv.Codigo_afip__c == 20 && TCVNombrePDF == ''}">{!$Label.erpvs__printsaleselectronicinvoiceexp_8}</apex:outputText> <apex:outputText value="{!TCVNombrePDF}" rendered="{!TCVNombrePDF != ''}"/> </b> </td> </tr> <tr> <td style="font-size:12px;">{!$Label.printSalesElectronicInvoiceExp_47}: <b><apex:outputText value="{!wHeaderFooter.numero}"/> </b></td> <td rowspan="3" style="text-align: right;"> <apex:outputPanel styleClass="vistaPrevia" rendered="{!isVistaPrevia}"> <table border="0" cellspacing="0" cellspading="0" width="100%"> <tr> <td style="font-size: 24px; font-weight: bold; text-align: center;"> {!$Label.erpvs__printsaleselectronicinvoiceexp_9} </td> </tr> <tr> <td style="font-size: 11px; font-weight: bold; text-align: center;"> {!$Label.erpvs__printsaleselectronicinvoiceexp_10} </td> </tr> </table> </apex:outputPanel> </td> </tr> <tr> <td style="font-size:11px;">{!$Label.printSalesElectronicInvoiceExp_11}: <apex:outputText value="{!wHeaderFooter.fecha}"/></td> </tr> <tr> <td style="font-size:11px;" colspan="2"><b>{!$Label.printSalesElectronicInvoiceExp_12}:</b> <apex:outputField value="{!datosEmpresa.Identificacion_Tributaria__c}"/></td> </tr> <tr> <td style="font-size:11px;"><b>{!$Label.printSalesElectronicInvoiceExp_13}:</b> <apex:outputField value="{!datosEmpresa.Otra_Identificacion_Tributaria__c}"/></td> </tr> <tr> <td style="font-size:11px;" colspan="2">{!$Label.printSalesElectronicInvoiceExp_14}: <apex:outputText value="{!wHeaderFooter.fechaInicioActividadesHeader}"/></td> </tr> <tr> <td style="font-size:11px;" colspan="2">{!$Label.printSalesElectronicInvoiceExp_15}</td> </tr> </table> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:10px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;"> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_16}:</b> <apex:outputText value="{!wHeaderFooter.nombreCliente}"/></td> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_17}:</b> <apex:outputText value="{!wHeaderFooter.domicilioCliente}"/></td> </tr> <tr> <td><b>{!$Label.printSalesElectronicInvoiceExp_18}:</b> <apex:outputText value="{!wHeaderFooter.CUITPais}"/></td> <td></td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:10px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;"> <!-- <tr> <td width="50%"><b>Currency:</b> <apex:outputText value="{!wHeaderFooter.moneda}"/></td> </tr> --> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_19}:</b> <apex:outputText value="{!wHeaderFooter.paisDestino}"/></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_20}:</b> <apex:outputText value="{!wHeaderFooter.permisosEmbarque}"/></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_21}:</b> <apex:outputText value="{!wHeaderFooter.puertoDestino}"/></td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:10px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;"> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_22}:</b> <apex:outputText value="{!wHeaderFooter.condicionVenta}"/></td> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_23}:</b> <apex:outputText value="{!wHeaderFooter.incoterms}" /></td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:10px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;"> <tr> <td width="50%" colspan="2"><apex:outputText value="{!wHeaderFooter.primeraLinea}"/></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_24}:</b> <apex:outputText value="{!wHeaderFooter.shipper}"/></td> <td width="50%"><apex:outputText value="{!wHeaderFooter.comprobanteAsociado}" escape="false"/></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_25}:</b> <apex:outputText value="{!wHeaderFooter.brand}"/></td> <td width="50%"></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_26}:</b> <apex:outputText value="{!wHeaderFooter.mv}"/></td> <td width="50%"></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_27}:</b> <apex:outputText value="{!wHeaderFooter.destination}"/></td> <td width="50%"></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_28}:</b> <apex:outputText value="{!wHeaderFooter.container}"/></td> <td width="50%"></td> </tr> </table> </div> <div class="footer"> <apex:outputPanel rendered="{! NOT(isFacturaA) && !isVistaPrevia}" layout="none"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="50%"> </td> <td width="50%"> <table border="0" cellspacing="0" cellpadding="0" style="font-size:10px;padding-top:10px;padding-left:10px;" width="100%"> <tr> <td> <table border="0" cellspacing="0" cellpadding="0" style="text-align:right;padding-right:10px;" width="100%"> <tr> <td> <apex:image url="{!urlQR}" /> </td> </tr> <tr> <td style="font-size:9px;">{!$Label.printSalesElectronicInvoiceExp_29}: <apex:outputText value="{!wHeaderFooter.cae}"/> - {!$Label.printSalesElectronicInvoiceExp_30}: <apex:outputText value="{!wHeaderFooter.fechaVencimientoCAE}"/></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </apex:outputPanel> </div> <apex:repeat value="{!pages}" var="page" > <div class="{!IF(page < pagesQty, 'divPage', 'lastPage')}"> <p style="font-size:10px;"> <apex:outputPanel layout="none" rendered="{!NOT(agrupar)}"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td style="text-align:right;padding-right:4px;">{!$Label.printSalesElectronicInvoiceExp_31}</td> <td style="padding-left:2px;" width="400px">{!$Label.printSalesElectronicInvoiceExp_32}</td> <td style="text-align:right;padding-right:2px;">{!$Label.printSalesElectronicInvoiceExp_33}</td> <td style="text-align:right;padding-right:2px;">{!$Label.printSalesElectronicInvoiceExp_34}(<apex:outputText value="{!wHeaderFooter.simboloMoneda}" />)</td> <td style="text-align:right;padding-right:2px;">{!$Label.erpvs__printsaleselectronicinvoiceexp_35}(<apex:outputText value="{!wHeaderFooter.simboloMoneda}" />)</td> </tr> <tr style="display:{!IF(page > 1, 'inline', 'none')}; font-weight: bold;"> <td colspan="4" style="text-align: right;"> {!$Label.erpvs__printsaleselectronicinvoiceexp_36}: </td> <td style="text-align:right;padding-right:2px;"> <apex:outputText value="{!subtotales[page-1]}"/> </td> </tr> <apex:repeat value="{!items}" var="item" first="{!(QTY_PER_PAGE * (page-1))}" rows="{!QTY_PER_PAGE}"> <tr> <td style="text-align:right;padding-right:4px;height:15px;"> <apex:outputText value="{!item.itemNumber}"/> </td> <td style="padding-left:2px;"> <apex:outputText value="{!item.description}" /> </td> <td style="text-align:right;padding-right:2px;"> <apex:outputText value="{!item.quantity}"/> {!$Label.printSalesElectronicInvoiceExp_37}: <apex:outputText value="{!item.unidad}"/><br/> </td> <td style="text-align:right;padding-right:2px;"> <apex:outputText value="{!item.unitPrice}" rendered="{! NOT(isFacturaA)}"/> </td> <td style="text-align:right;padding-right:2px;"> <apex:outputText value="{!item.ammountPerItem}" /> </td> </tr> </apex:repeat> </table> </apex:outputPanel> </p> <apex:outputPanel rendered="{! NOT(isFacturaA) && (page < pagesQty)}" style="position: relative;" > <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:14px;border-style: solid; border-top-width: 1px; border-bottom-width: 1px;" > <tr> <td width="50%"></td> <td width="50%" style="text-align:right;padding-right:2px;"><b>{!$Label.printSalesElectronicInvoiceExp_38}:</b> <apex:outputText value="{!subtotales[page]}"/></td> </tr> </table> </apex:outputPanel> </div> <apex:outputPanel layout="none" rendered="{! NOT(isFacturaA) && (page == pagesQty)}"> <div style="width:100%;page-break-inside: avoid;position: fixed; bottom: 0px;"> <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:10px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;" > <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_39}:</b> <apex:outputText value="{!wHeaderFooter.exchangeRate}"/></td> <td width="50%" style="text-align:right;padding-right:2px;"><b>{!$Label.printSalesElectronicInvoiceExp_40}:</b> <apex:outputText value="{!wHeaderFooter.moneda}"/></td> </tr> <tr> <td></td> <td style="font-size:12px;text-align:right;padding-right:2px;"><b>{!$Label.printSalesElectronicInvoiceExp_41}: <apex:outputText value="{!wHeaderFooter.simboloMoneda}" /> <apex:outputText value="{!totalDolares}"/></b></td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding-left:20px;font-size:10px;border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;"> <tr style="{!IF(wHeaderFooter.pallets == '0', 'display:none', '')}"> <td width="50%"><apex:outputText value="{!wHeaderFooter.pallets}"/> {!$Label.printSalesElectronicInvoiceExp_42} <apex:outputText value="{!wHeaderFooter.kgPallets} kg." rendered="{!wHeaderFooter.kgPallets != ''}"/></td> <td width="50%"></td> </tr> <tr style="{!IF(wHeaderFooter.cartons == '0', 'display:none', '')}"> <td width="50%"><apex:outputText value="{!wHeaderFooter.cartons}"/> {!$Label.printSalesElectronicInvoiceExp_43}</td> <td width="50%"></td> </tr> <tr> <td width="50%"><apex:outputText value="{!wHeaderFooter.kgGrossWeight}" /> {!$Label.printSalesElectronicInvoiceExp_44}</td> <td width="50%"></td> </tr> <tr> <!-- <td width="50%"><apex:outputText value="{!wHeaderFooter.kgNetWeight}" /> {!$Label.printSalesElectronicInvoiceExp_45}</td> --> <td width="50%"><apex:outputText value="{!wHeaderFooter.kgNetWeight}" /> {!unidades} {!IF(unidades == 'UNI', 'Quantity' , 'Net Weight')}</td> <td width="50%"></td> </tr> <tr> <td width="50%"><b>{!$Label.printSalesElectronicInvoiceExp_46} <apex:outputText value="{! IF(tieneFlete, ' FOB', '') }" /> <apex:outputText value="{!wHeaderFooter.simboloMoneda}" />:</b> <apex:outputText value="{!totalFOB}"/></td> <td width="50%"></td> </tr> </table> <p style="font-size: 9px;"><apex:outputText value="{!wHeaderFooter.cv.Texto_pie_FE__c}" rendered="{!wHeaderFooter.cv.Texto_pie_FE__c != null}"/> </p> </div> </apex:outputPanel> </apex:repeat> </div> </apex:component>
Hey Joaquin,
Have you the back up code of the visualforce page, if yes, replace it and then test. Also check the Audit trail if any modification done and by whom.
Thanks,
Priya ranjan
Inside the first three <tr> elements, the first <td> of each <tr> are the lines. For some reason, if anything is added inside those <td> elements, the vf throws the error. even if I remove the output text and label, and just type "hello" in plain text, inside any of those <td>, it breaks. It is a weird behavior, do you know what could be happening?