Hi,
Wonder if someone can help. I have the following code that I am using to convert a pdf file into image files and then add to my document:
<code>
//get file data
$file_data = pathinfo( $file_to_append );
//before doing any work, check if the file is a PDF. If it it is, converto to image and reset the info for this loop
//it'll run as an image instead then.
if ( $file_data['extension'] == "pdf" ) {
$merger->convert_from_pdf( $file_to_append, $tmp_path, $tmp_counter, $file_data, $merge_options );
} elseif( in_array( $file_data['extension'], $allowed_images ) ) {
//is it an image?
$merger->add_image_to_doc( $file_to_append, $tmp_path, $tmp_counter, $file_data );
</code>
If I use individual image files the code works fine and the images are placed on individual pages. If I use a pdf, the pdf is converted to images but they are all stacked on top of each other on a single page of the word document. Can anyone help with resolving this issue. I did not write the code and the original developer cannot assist.
Many thanks
Mark