Thread: .pdf file

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    kingston jamaica
    Posts
    28

    .pdf file

    Will c write and read effectively from a .pdf file?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    If you use a third-party library for reading and writing from/to a .pdf file.

  3. #3
    Registered User
    Join Date
    Apr 2010
    Location
    kingston jamaica
    Posts
    28
    ooh. That not gonna happen.

    Is there any read only file types that c supports

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    By itself, all C does is read the file, byte for byte. There are no "file types" whatsoever. If you want to read/write a specific format (either one that exists out there, or that you dream up), then you need to either find or write the code to write the data and to read it in.

  5. #5
    Registered User
    Join Date
    Apr 2010
    Location
    kingston jamaica
    Posts
    28
    so if i put
    Code:
    fopen("file.pdf"."r");
    it will open and write to a pdf file?

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by jamaican1231 View Post
    so if i put
    Code:
    fopen("file.pdf"."r");
    it will open and write to a pdf file?
    You can't write if you open with "r". (And it will read byte-for-byte, but it's not going to contain the data you want, I expect.) If you open with "w", you will write a text file that has a .pdf extension, but this does not make it a .pdf file.

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    214

  8. #8
    Registered User UltraKing227's Avatar
    Join Date
    Jan 2010
    Location
    USA, New york
    Posts
    123
    Ok, fopen may help, but its used to read\write (r\w) to a file.
    if you want to make a PDF file using fopen\fprintf, lets just say,
    you will just make a .txt file with the .pdf extention. unless,
    you study the core of pdf and use fprint following the core of
    a pdf.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  3. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM