Yosef Karo, Translation:Shulchan Aruch — Orach Chaim 533…
“ Paragraph 3 - If fruits have ripened a bit such that they can be eaten in a stretch, it is permitted to collect them in order to eat them. If one collected them to eat them, collected too much, and he now worries that they will rot if they are not pickled to remove the moisture, he can pickle them. However, it is forbidden to collect in order to pickle. If there is something that won't be available after the holiday, it is permitted to buy it and pickle it. ”
