The Shulchan Aruch · Orach Chayim
אורח חיים שנ״בOrach Chayim 352
Siman 352 of 697 in Orach Chayim — 2 se'ifim
הלכות ערוביןLaws of Eruvin· siman 352
Se’if 1א׳
הַקּוֹרֵא בְּסֵפֶר עַל הָאַסְקֻפָּה וְנִתְגַּלְגֵּל רֹאשׁ הָאֶחָד מֵהַסֵפֶר מִיָּדוֹ, וְנִשְׁאַר רֹאשׁ הַשֵּׁנִי בְּיָדוֹ, גּוֹלְלוֹ אֶצְלוֹ. אֲפִלּוּ נִתְגַּלְגֵּל חוּץ לְד' אַמּוֹת, וַאֲפִלּוּ בִּרְשׁוּת הָרַבִּים וְהָאַסְקֻפָּה בִּרְשׁוּת הַיָּחִיד, מִשּׁוּם בִּזְיוֹן כִּתְבֵי הַקֹּדֶשׁ הִתִּירוּ. הַגָּה: דְּרַבִּים דָּרְסֵי עַל הָאַסְקֻפָּה. וְדַוְקָא כִּתְבֵי הַקֹּדֶשׁ, אֲבָל בִּשְׁאָר דְּבָרִים אָסוּר, אֲפִלּוּ לֹא נָפְלוּ אֶלָּא לְכַרְמְלִית. (הַמַּגִּיד פט"ו וְהָרַשְׁבָּ"א).
Someone who reads a scroll that rolls from domain to domain. Containing 2 paragraphs: If someone is reading a scroll on the doorstep and one side of it rolls from his hand, but the other side stays in his hand, he can roll it back, even if it rolled outside of his four amot, even into the public domain and the doorstep is in the private domain. Because of the potential mistreatment of holy texts, this was allowed. Rema: This is because many people walk on the doorstep. This is specifically regarding holy texts, but one is forbidden to roll back other texts even if they only fell into the karmelit (HaMagid chapter 15 and Rashb"a).
Se’if 2ב׳
הָיָה קוֹרֵא בּוֹ עַל הַגַּג וְנִתְגַּלְגֵּל רֹאשׁוֹ הָאֶחָד מִיָּדוֹ, עַד שֶׁלֹּא הִגִּיעַ לַעֲשָׂרָה טְפָחִים הַתַּחְתּוֹנִים הַקְּרוֹבִים לָאָרֶץ, גּוֹלְלוֹ אֶצְלוֹ; הִגִּיעַ לַעֲשָׂרָה טְפָחִים הַתַּחְתּוֹנִים, אִם הַכֹּתֶל מְשֻׁפָּע בְּעִנְיָן שֶׁנָּח עָלָיו, אָסוּר לְגָלְלוֹ אֶצְלוֹ; וּכְדֵי שֶׁלֹּא יַעֲמֹד בְּבִזָּיוֹן, הוֹפְכוֹ עַל הַכְּתָב. וְאִם אֵינוֹ מְשֻׁפָּע, כָּל זְמַן שֶׁלֹּא הִגִּיעַ לָאָרֶץ גּוֹלְלוֹ אֶצְלוֹ.
If someone was reading on the roof and one side of the scroll rolled from his hand, if it hasn't reached within ten tefachim of the ground, he may roll it back. If it reached the bottom ten tefachim and the wall is slanted such that the scroll can rest on it, it is forbidden to roll it back; so that it is not mistreated, he should turn it around onto the text. If the wall is not slanted, as long as it has not reached the ground, he may roll it back.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0