A printing apparatus, comprising: a transport unit configured to transport a fabric formed with a pattern in a transport direction; an imaging unit configured to image the fabric transported by the transport unit; a printing unit configured to perform printing on the fabric transported by the transport unit; a pattern extracting unit configured to, based on a comparison between first image data representing the pattern and second image data generated by imaging the fabric by the imaging unit, extract a pattern region corresponding to the pattern in the second image data; a printing image generation unit configured to arrange third image data representing an image to be printed overlaid on the pattern so that the third image data matches the pattern region extracted, to generate printing image data; and a printing control unit configured to cause the printing unit to print the printing image data on the fabric, characterized in that: the pattern extracting unit performs first extracting processing for extracting the pattern region from a first region of the second image data, and second extracting processing for extracting the pattern region from a second region of the second image data, wherein a part of the second region is an overlapping region overlapping the first region, and a length in the transport direction of the overlapping region is equal to or greater than a length in the transport direction of the first image data, and wherein the pattern extracting unit, after the second extracting processing, sets, in the first region or the second region, a line that is directed in a direction intersecting the transport direction and is a boundary line corresponding to a boundary between the pattern regions extracted, and provides information of the pattern region in a region downstream in the transport direction from the boundary line to the printing image generation unit for generation of the printing image data. a transport unit configured to transport a fabric formed with a pattern in a transport direction; an imaging unit configured to image the fabric transported by the transport unit; a printing unit configured to perform printing on the fabric transported by the transport unit; a pattern extracting unit configured to, based on a comparison between first image data representing the pattern and second image data generated by imaging the fabric by the imaging unit, extract a pattern region corresponding to the pattern in the second image data; a printing image generation unit configured to arrange third image data representing an image to be printed overlaid on the pattern so that the third image data matches the pattern region extracted, to generate printing image data; and a printing control unit configured to cause the printing unit to print the printing image data on the fabric, characterized in that: the pattern extracting unit performs first extracting processing for extracting the pattern region from a first region of the second image data, and second extracting processing for extracting the pattern region from a second region of the second image data, wherein a part of the second region is an overlapping region overlapping the first region, and a length in the transport direction of the overlapping region is equal to or greater than a length in the transport direction of the first image data, and wherein the pattern extracting unit, after the second extracting processing, sets, in the first region or the second region, a line that is directed in a direction intersecting the transport direction and is a boundary line corresponding to a boundary between the pattern regions extracted, and provides information of the pattern region in a region downstream in the transport direction from the boundary line to the printing image generation unit for generation of the printing image data. the pattern extracting unit performs first extracting processing for extracting the pattern region from a first region of the second image data, and second extracting processing for extracting the pattern region from a second region of the second image data, wherein a part of the second region is an overlapping region overlapping the first region, and a length in the transport direction of the overlapping region is equal to or greater than a length in the transport direction of the first image data, and wherein the pattern extracting unit, after the second extracting processing, sets, in the first region or the second region, a line that is directed in a direction intersecting the transport direction and is a boundary line corresponding to a boundary between the pattern regions extracted, and provides information of the pattern region in a region downstream in the transport direction from the boundary line to the printing image generation unit for generation of the printing image data.