cambraydesign 0 Newbie Poster

What I want to do is embed a pdf on a web page or use a js library for viewing pdf and have an option to click on the pdf. This saves the coordinates and page of the pdf that you are on.

I can then send these coordinates for use by someone else to insert at that point.

Here's my code for the PDF, I'm using fpdi. You'll see where I want to set the coordinates. $pdf->Image('images/sds-overlay.jpg',0,0,0);

require_once('fpdf/fpdf.php');
require_once('fpdi/fpdi.php');

try{

$query1 = "SELECT myFile FROM ".$company."_automated_responses WHERE unid = '".$_GET['unid']."'";
$stmt1 = $db->prepare( $query1 );                           
$stmt1->execute(); 
while ($row = $stmt1->fetch(PDO::FETCH_ASSOC)){ 
    $myFile = $row['myFile'];
    }

}catch(PDOException $exception){
}

if($myFile !=""){

$pdf = new FPDI();
//$pdf->AddPage();

//Set the source PDF file
$pageCount = $pdf->setSourceFile("uploads/".$company."/".$myFile."");

// iterate through all pages
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
    // import a page
    $templateId = $pdf->importPage($pageNo);
    // get the size of the imported page
    $size = $pdf->getTemplateSize($templateId);


    // create a page (landscape or portrait depending on the imported page size)
    if ($size['w'] > $size['h']) {
        $pdf->AddPage('L', array($size['w'], $size['h']));
    } else {
        $pdf->AddPage('P', array($size['w'], $size['h']));
    }

    // use the imported page
    $pdf->useTemplate($templateId);

    $pdf->Image('images/sds-overlay.jpg',0,0,0);
}


$pdf->Output("uploads/".$company."/P-".$myFile."", "F");

If anyone has any idea where to start with this !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.