Regulations Governing Visiting, Residency, and Permanent Residency of Aliens Article 4

Any foreign national who is permitted to enter the ROC with a visa waiver or a visa applied for upon his/her arrival after verification, and who is unable to leave the ROC before his/her duration of stay expires due to any of the circumstances under Article 4 of the Enforcement Rules for Issuance of ROC Visas to Foreign Passport Holders, shall apply for a visitor visa with the Bureau of Consular Affairs, Ministry of Foreign Affairs or any of its branches.
中文原文 外國人停留居留及永久居留辦法第4條
外國人以免簽證方式或抵我國時申請簽證,並經查驗許可入國,有外國護照簽證條例施行細則第四條各款情形之一,無法於停留期限屆滿前出國者,應向外交部領事事務局或其所屬分支機構申請停留簽證。

English translation for reference only; the Chinese text prevails. Not legal advice.