<?php require_once('fpdf/fpdf.php'); require_once('fpdi/fpdi.php'); require_once('connectionphp'); $strSQL = "SELECT * FROM files WHERE FilesID = '".$_GET["FilesID"]."' "; $objQuery = sqlsrv_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult =sqlsrv_fetch_assoc($con,$objQuery); header("Content-Type: ".$objResult["FilesType"]); $pdf = new FPDI(); $pdf->AddPage(); $pdf->setSourceFile($objResult["FilesName"]); //here $objResult["FilesName"] is the varbinary field extracted from database $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx, 10, 10, 100); $pdf->SetFont('Helvetica'); $pdf->SetTextColor(255, 0, 0); $pdf->SetXY(30, 30); $pdf->Write(0, 'I tried it'); $pdf->Output(); ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)