pdf conversion using pattern library