Php 에서 pdf 편집하든 좋은 방법 아는 사람? 대부분 오픈 소스 / 제로 라이센스에서 비용을 줄일 수 있습니다. )
나는 열 PDF 파일을 텍스트 줄을 따라 사고 후 먹어서나 아웃해야 교체하십니까 PDF 의 수정된 버전의 PDF?
하지만 나는 PDF 파일을 사용하여 만든 프로그램을 통해 과거 펠릭스 포드프 다루기 힘든 시간에 조금 그것을 발견했다.
<?php
require_once 'Zend/Pdf.php';
$pdf = Zend_Pdf::load('blank.pdf');
$page = $pdf->pages[0];
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
$page->setFont($font, 12);
$page->drawText('Hello world!', 72, 720);
$pdf->save('zend.pdf');
Pdf 문서로 구성되어 있으며 일련의 원시적인 드로잉 작업: 여기, 여기 저기, 이미지, 텍스트 줄을 청크를 상술합니다. 이러한 프리미티브를 레이아웃용 의도에 대한 정보를 포함하지 않는다.
무료로 사용할 수 있으며 PDF 문서를 PDF 클래스를 작성할 수 있습니다. # 39 의 불렀으매 it& 펠릭스 포드프. (Http://www.setasign.de/products/pdf-php-solutions/fpdi) 과 함께 파파디 PDF 문서를 편집할 수 있는 것도 가능합니다. 다음 코드와 함께 기존 사용자 데이터를 사용 방법 및 파파디 펠릭스 포드프 칠하려면 쿠폰 선물.
require_once('fpdf.php');
require_once('fpdi.php');
$pdf = new FPDI();
$pdf->AddPage();
$pdf->setSourceFile('gift_coupon.pdf');
// import page 1
$tplIdx = $this->pdf->importPage(1);
//use the imported page and place it at point 0,0; calculate width and height
//automaticallay and ajust the page size to the size of the imported page
$this->pdf->useTemplate($tplIdx, 0, 0, 0, 0, true);
// now write some text above the imported page
$this->pdf->SetFont('Arial', '', '13');
$this->pdf->SetTextColor(0,0,0);
//set position in pdf document
$this->pdf->SetXY(20, 20);
//first parameter defines the line height
$this->pdf->Write(0, 'gift code');
//force the browser to download the output
$this->pdf->Output('gift_coupon_generated.pdf', 'D');
정말 필요한 경우 간단한 pdf 관심용 젠드 또는 펠릭스 포드프 정상입니다. 그러나 내가 답답한 것은 어렵고 것들이었다고요 작업할 수 있습니다. 또한, s no good # 39 는 API 를 방식 때문에 별도의 방법을 통한 비즈니스 there& 프레젠테이션에서 내용이 없다.
이러한 이유로, HTML, CSS 를 동프드프 를 사용하고 있으며, 자동 변환하여 PDF 문서. 낼 수 있는 것처럼 아웃하려면 템플리트를 작업에서와 html 페이지를 및 사용 표준 HTML 구문. 외부 CSS 파일이 포함할 수도 있습니다. 가끔, 아주 복잡한 수정표시 또는 css 가 완벽한 라이브러리 isn& # 39, t, t, but I haven& # 39 사용할 수 있는 다른 사항은요 com/downloads/global/corporate/iar/esg_prosupport. 보일 정도로 잘 알려져 있다.
http://www.setasign.de/products/pdf-php-solutions/fpdi/
기본적으로 같은 일을 할 수 있습니다. Pdf 를 통해 상단형 로드하십시오 쓰기 위해 새로운 PDF 저장 후. 기본적으로 장착합니다 너회가 파파디 에서 PDF 이미지로 동일팔레트에 수 있도록 원하는 대로 계양되었다.
하지만, 이 때문에 don& 펠릭스 포드프 사용하는 경우, t want to use it won& # 39 그런 # 39, 빗나갔다.
정말 동프드프 (컴포지션이 준활성 idea) 이 문제에 대해 큰 기대를 가지고 있지만 내 주요 팩터에서의 펠릭스 포드프 사용하여 포지셔닝도 있다. 이는 모든 요소가 표시되어도 비효율적임 설정할 수 있다. 이 모든 나가버렷 강하심과 있다.
I lay my 작업공간에서 그 위에 내 이미지에 맞는 문서를 동일팔레트에 레이아웃용. 그 동안 충분한 대해서도 항상 그 열 (单捞磐啊 php 구체화하십시오 계산, 작은 약어입니다 요구했으나 아무 일도 너무 심히 흥분시키는).
행운을 빕니다.
우리가 사용하는 [페드프리브] (http://www.pdflib.com/pdflib-gmbh/) 의 PDF 파일을 만들 수 있다, 그리고 많은 다른 언어를 위한 바인딩을 레일 애플리케이션 PHP.
그러나 그들은 우리가 사용하는 이 상용이고 버전 또한 [자유 / 오픈 소스 버전] (http://www.pdflib.com/download/pdflib-family/pdflib-lite/) 디스크입니다. diskid 몇 가지 제한이 있다.
이 문제는 죄송합니다. PDF& # 39 을 만들 수 있습니다.
<?php
//getting new instance
$pdfFile = new_pdf();
PDF_open_file($pdfFile, " ");
//document info
pdf_set_info($pdfFile, "Auther", "Ahmed Elbshry");
pdf_set_info($pdfFile, "Creator", "Ahmed Elbshry");
pdf_set_info($pdfFile, "Title", "PDFlib");
pdf_set_info($pdfFile, "Subject", "Using PDFlib");
//starting our page and define the width and highet of the document
pdf_begin_page($pdfFile, 595, 842);
//check if Arial font is found, or exit
if($font = PDF_findfont($pdfFile, "Arial", "winansi", 1)) {
PDF_setfont($pdfFile, $font, 12);
} else {
echo ("Font Not Found!");
PDF_end_page($pdfFile);
PDF_close($pdfFile);
PDF_delete($pdfFile);
exit();
}
//start writing from the point 50,780
PDF_show_xy($pdfFile, "This Text In Arial Font", 50, 780);
PDF_end_page($pdfFile);
PDF_close($pdfFile);
//store the pdf document in $pdf
$pdf = PDF_get_buffer($pdfFile);
//get the len to tell the browser about it
$pdflen = strlen($pdfFile);
//telling the browser about the pdf document
header("Content-type: application/pdf");
header("Content-length: $pdflen");
header("Content-Disposition: inline; filename=phpMade.pdf");
//output the document
print($pdf);
//delete the object
PDF_delete($pdfFile);
?>