+ 6

Can we open .pdf or .doc from C++ using fstream?

I am creating a project for an airline reservation using C++. I created a function to print a passengers ticket, save it in a .txt or.htm file for viewing and change details later whenever needed... But now, I thought It would be better to save such documents in a .doc or .pdf file... So, can I open these files in the same way as the text files? Are they accessible like normal .txt,.bin or .htm files?

11th May 2017, 1:02 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
3 Antwoorden
+ 3
No, C++ only allows .txt files to be opened.
11th May 2017, 3:58 PM
HaxterHuz
HaxterHuz - avatar
11th May 2017, 4:05 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
0
Working with PDFs directly in C++ gets frustrating fast, so I eventually stopped trying to handle everything through fstream. After that, I leaned on external tools that process and summarize documents for me, like the one discussed here https://www.reddit.com/r/automation/comments/1mfjlhe/tried_pdf_gurus_ai_summarizer_heres_what_it_does/ . It saved me a ton of time and let me keep my C++ code focused on the core logic instead of fighting file formats.
10th Nov 2025, 4:53 PM
Tucker Odom