It's been a few weeks since i'm trying to get slds-order-- in Lightning Design System to work with renderAs="pdf" but the order is never maintained.
Please find below the sample code. When i preview a simple Vf page the order of divs are maintained but renderAs="pdf" doesn't seem to care about the order at all.
Please find the attached snapshot. You'd find that Vf does proper ordering as per the markup but once i place renderAs="pdf" it goes haywire.
If any other approach where i could use vanilla flex display to format the divs in a given order while renderAs="pdf" still kicking, is also fine. I'm aware of client side pdf rendering to convert the html -> canvas -> image -> pdf, but might be a lot of work to keep CSS intact along with pixels. I would go for that approach but, at the moment can't figure out why renderAs="pdf" does consider slds-order-- class at all.
Any help is highly appreciated.
Thanks, Sangram
<apex:page showHeader="false"
standardStylesheets="false"
sidebar="false"
docType="html-5.0"
>
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:stylesheet value="{!URLFOR($Resource.SLDS, 'styles/salesforce-lightning-design-system-vf.css')}" />
</head>
<body>
<!-- REQUIRED SLDS WRAPPER -->
<div class="slds">
<div class="slds-grid slds-wrap">
<div class="slds-col slds-size--1-of-1 slds-order--2">1</div>
<div class="slds-col slds-size--1-of-2 slds-order--1">2</div>
</div>
</div>
<!-- / REQUIRED SLDS WRAPPER -->
</body>
</html>
</apex:page>