本文整理汇总了C++中PDFPage::GetRotate方法的典型用法代码示例。如果您正苦于以下问题:C++ PDFPage::GetRotate方法的具体用法?C++ PDFPage::GetRotate怎么用?C++ PDFPage::GetRotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDFPage
的用法示例。
在下文中一共展示了PDFPage::GetRotate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
EStatusCode RotatedPagesPDF::Run(const TestConfiguration& inTestConfiguration)
{
LogConfiguration logConfiguration(true,true,RelativeURLToLocalPath(inTestConfiguration.mSampleFileBase,"RotatedPagesLog.txt"));
EStatusCode status;
do
{
// PDF Page rotation writing
PDFWriter pdfWriter;
status = pdfWriter.StartPDF(
RelativeURLToLocalPath(inTestConfiguration.mSampleFileBase,"RotatedPages.pdf"),
ePDFVersion13,logConfiguration);
if(status != PDFHummus::eSuccess)
{
cout<<"failed to start RotatedPages.pdf\n";
break;
}
AbstractContentContext::TextOptions textOptions(pdfWriter.GetFontForFile(
RelativeURLToLocalPath(
inTestConfiguration.mSampleFileBase,
"TestMaterials/fonts/arial.ttf")),
14,
AbstractContentContext::eGray,
0);
for(int i=0;i<6 && PDFHummus::eSuccess == status;++i)
{
PDFPage page;
page.SetMediaBox(PDFRectangle(0,0,595,842));
page.SetRotate(33);
if ( page.GetRotate().second != 0 )
{
status = PDFHummus::eFailure;
cout<<"Failed to reject invalid rotation\n";
break;
}
page.SetRotate(i*90);
std::ostringstream s;
s << "Page rotated by " << i*90 << " degrees.";
PageContentContext* cxt = pdfWriter.StartPageContentContext(&page);
cxt->WriteText(75,805,s.str(),textOptions);
status = pdfWriter.EndPageContentContext(cxt);
if(status != eSuccess)
{
status = PDFHummus::eFailure;
cout<<"Failed to end content context\n";
break;
}
status = pdfWriter.WritePage(&page);
if(status != PDFHummus::eSuccess)
cout<<"failed to write page "<<i<<"\n";
}
status = pdfWriter.EndPDF();
if(status != PDFHummus::eSuccess)
{
cout<<"failed in end RotatedPages.pdf\n";
break;
}
// PDF page rotation copy
status = pdfWriter.StartPDF(
RelativeURLToLocalPath(inTestConfiguration.mSampleFileBase,"RotatedPagesCopy.pdf"),
ePDFVersion13);
if(status != PDFHummus::eSuccess)
{
cout<<"failed to start RotatedPagesCopy.pdf\n";
break;
}
EStatusCodeAndObjectIDTypeList result;
// append pages
result = pdfWriter.AppendPDFPagesFromPDF(
RelativeURLToLocalPath(inTestConfiguration.mSampleFileBase,"RotatedPages.pdf"),
PDFPageRange());
if(result.first != PDFHummus::eSuccess)
{
cout<<"failed to append pages from RotatedPages.pdf\n";
status = result.first;
break;
}
status = pdfWriter.EndPDF();
if(status != PDFHummus::eSuccess)
{
cout<<"failed in end RotatedPagesCopy.pdf\n";
//.........这里部分代码省略.........