Title: [Plugin: article2pdf] PDF format unrecognize
Last modified: August 19, 2016

---

# [Plugin: article2pdf] PDF format unrecognize

 *  Resolved [hobong](https://wordpress.org/support/users/hobong/)
 * (@hobong)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-article2pdf-pdf-format-unrecognize/)
 * I’m using article2pdf and it can generate a pdf file which automaticly downloaded
   but there’s error when open the pdf file, it says :
 * > Couldn’t open the file. It may be corrupt or a file format that Preview doesn’t
   > recognize.
 * Here I provide a link :
    [](http://gemapendidikan.com/2010/04/problematika-pendidikan/?article2pdf=1)
 * Any help ?
    Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [hobong](https://wordpress.org/support/users/hobong/)
 * (@hobong)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-article2pdf-pdf-format-unrecognize/#post-1465646)
 * SOLVED :
    it’s because the webserver does not allow using readfile() here is 
   the code from article2pdf_getfile.php on about line 44
 *     ```
       $tmpfile = $tmpdir . (substr( $tmpdir, -1 ) != '/' ? '/' : '') . 'a2p.tmp.' . $post_name . '.' . $tmprand . '.pdf';
       	if( file_exists( $tmpfile ) )
       	{
       		if( $_GET[ 'debug_pdf_file' ] != '1' )
       		{
       			header( "Content-Type: application/pdf" );
       			header( "Content-Disposition: attachment; filename=\"" . $post_name . ".pdf\"" );
       		}
       		//readfile( $tmpfile );
                       <strong>// replace with </strong>
                      echo file_get_contents($tmpfile);
       		unlink( $tmpfile );
       	}
       	else	die( 'Sorry no pdf tempfile found. Please try again.' );
       ```
   
 * Hope it helps other

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: article2pdf] PDF format unrecognize’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [hobong](https://wordpress.org/support/users/hobong/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-article2pdf-pdf-format-unrecognize/#post-1465646)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
