Nowadays, the high volume of archival documents has made it exigent to store documents in electronic databases. A text logo represents the ownership of the text, and different texts can be categorized by it; for this reason, different methods have been presented for extracting and recognizing logos. The methods presented earlier, suffer problems such as, error of logo detection and recognition and slow speed. The proposed method of this study is composed of three sections: In the first section, the exact position of the logo can be identified by the pyramidal tree structure and horizontal and vertical analysis, and in the second section, the logo can be extracted through the algorithm of the boundary extension of feature rectangles. In the third section, after normalizing the size of the logo and eliminating the skew angle, for feature extraction, we first blocked the region encompassing the logo, and then we extract a particular feature by the parameter of the center of gravity of connected component each block. Finally, we use the KNN classification for the recognition of the logo.