Jump to content

PDF rotate text (presta 1.5.3)


Recommended Posts

Can any person have idea, need to rotate text inside PDF

i write this code inside render method:

 

$this->pdf_renderer->createFooter($template->getFooter());

$this->pdf_renderer->createContent($template->getContent());

 

 

$this->pdf_renderer->SetDrawColor(200);

$this->pdf_renderer->SetTextColor(200);

$this->pdf_renderer->Rect(70, 100, 40, 10, 'D');

$this->pdf_renderer->Text(70, 96, 'RotateLLLLLLLLLL');

$this->pdf_renderer->SetDrawColor(0);

$this->pdf_renderer->SetTextColor(0);

$this->pdf_renderer->StartTransform();

 

$this->pdf_renderer->Rotate(20, 70, 110);

$this->pdf_renderer->Rect(70, 100, 40, 10, 'D');

$this->pdf_renderer->Text(70, 96, 'RotateLLLLLLLLLL');

// Stop Transformation

$this->pdf_renderer->StopTransform();

 

$this->pdf_renderer->writePage();

 

 

But didn't work, i'm using presta 1.5.3

Link to comment
Share on other sites

  • 2 months later...

How about the following code to rotate text:

public static string FolderName = "c:/";

 

private void button1_Click(object sender, EventArgs e)

{

string fileName = FolderName + "Sample.pdf";

 

REDocument doc = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file

 

BasePage aPage = doc.GetPage(0);

 

REImage reImage = (REImage)aPage.ToImage();

 

REFile.SaveImageFile(reImage, "c:/reimage1.png", new PNGEncoder());

 

REImage reImage1 = REFile.OpenImageFile("c:/reimage1.png");

 

ImageProcessing.ApplyRotate(reImage1, 90);

 

REFile.SaveImageFile(reImage1, "c:/reimage.png", new PNGEncoder());

}

Link to comment
Share on other sites

×
×
  • Create New...