To provide a front transparent electrode for use in highly efficient hydrogenated amorphous silicon (a-Si:H) thin-film solar cells, porous flat layer and micro-patterns of zinc oxide (ZnO) nanoparticle (NP) layers were prepared through ultraviolet nanoimprint lithography (UV-NIL) and deposited on Al-doped ZnO (AZO) layers. Through this, it was found that a porous micro-pattern of ZnO NPs dispersed in resin can optimize the light-trapping pattern, with the efficiency of solar cells based on patterned or flat mesoporous ZnO layers increased by 27% and 12%, respectively.