If you face “PDF generation failed. Check the page markup is valid” issue while rendering a Visulaforce page as PDF, do the following
1. Remove RenderAs attribute from apex:page and check whether any error pops out. Sometimes, error will not be shown on the PDF page.
2. Remove sections of codes and find the exact code where the issues is.