We describe the self-organization of PCBM and a cyanine dye on chemically patterned surfaces during spin coating from solution. On homogeneous surfaces, a transient bilayer forms, which in a later stage decomposes into PCBM droplets in a matrix of the cyanine dye. On the patterned surface also a PCBM droplet phase develops, but the final film structure is greatly determined by contact line pinning of the PCBM domains to the substrate pattern. Three characteristic morphology regimes separated by wetting transitions were observed for different ratios between the natural domain dimensions and the underlying pattern periodicity. We demonstrate that contact line pinning can be an important means to control the film morphology in systems where films are coated from solution. This process can be exploited as a general and versatile method for patterning small semiconducting molecules into 1D and 2D photonic crystals.