Ipelib
|
#include <ipelatex.h>
Public Member Functions | |
Latex (const Cascade *sheet, LatexType latexType, bool sequentialText) | |
~Latex () | |
int | scanObject (const Object *obj) |
int | scanPage (Page *page) |
void | addPageNumber (int pno, int vno, int npages, int nviews) |
int | createLatexSource (Stream &stream, String preamble) |
bool | readPdf (DataSource &source) |
bool | updateTextObjects () |
PdfResources * | takeResources () |
Friends | |
class | ipe::TextCollectingVisitor |
Object that converts latex source to PDF format.
This object is responsible for creating the PDF representation of text objects.
Create a converter object.
References ipe::Xetex.
Latex::~Latex | ( | ) |
Destructor.
int Latex::scanObject | ( | const Object * | obj | ) |
Scan an object and insert all text objects into Latex's list. Returns total number of text objects found so far.
References ipe::Object::accept().
int Latex::scanPage | ( | Page * | page | ) |
Scan a page and insert all text objects into Latex's list. Returns total number of text objects found so far.
References ipe::Text::accept(), ipe::Object::accept(), ipe::Page::applyTitleStyle(), ipe::Page::count(), ipe::Page::invalidateBBox(), ipe::Page::object(), and ipe::Page::titleText().
void Latex::addPageNumber | ( | int | pno, |
int | vno, | ||
int | npages, | ||
int | nviews | ||
) |
Create Text object to represent the page number of this view.
References ipe::PdfResources::addPageNumber(), ipe::Text::ELabel, ipe::String::empty(), ipe::Cascade::findPageNumberStyle(), ipe::StyleSheet::PageNumberStyle::iColor, ipe::AllAttributes::iHorizontalAlignment, ipe::StyleSheet::PageNumberStyle::iHorizontalAlignment, ipe::StyleSheet::PageNumberStyle::iPos, ipe::StyleSheet::PageNumberStyle::iSize, ipe::AllAttributes::iStroke, ipe::StyleSheet::PageNumberStyle::iText, ipe::AllAttributes::iTextSize, ipe::AllAttributes::iVerticalAlignment, ipe::StyleSheet::PageNumberStyle::iVerticalAlignment, ipe::PdfResources::SPageNumber::page, ipe::Text::size(), ipe::PdfResources::SPageNumber::text, and ipe::PdfResources::SPageNumber::view.
Create a Latex source file with all the text objects collected before. The client should have prepared a directory for the Pdflatex run, and pass the name of the Latex source file to be written by Latex.
Returns the number of text objects that did not yet have an XForm, or a negative error code.
References ipe::Cascade::allNames(), ipe::Attribute::color(), ipe::EColor, ipe::ELabelStyle, ipe::String::empty(), ipe::String::erase(), ipe::ETextSize, ipe::ETextStretch, ipe::ETextStyle, ipe::String::find(), ipe::Cascade::find(), ipe::Cascade::findPreamble(), ipe::Text::getXForm(), ipe::String::hasPrefix(), ipe::Color::iBlue, ipe::Color::iGreen, ipe::Color::iRed, ipe::Color::isGray(), ipe::Text::isMinipage(), ipe::Attribute::isNumber(), ipe::String::left(), ipe::Luatex, ipe::Fixed::mult(), ipe::Attribute::number(), ipe::String::size(), ipe::size(), ipe::Attribute::string(), ipe::Text::stroke(), ipe::Text::style(), ipe::String::substr(), ipe::Text::text(), ipe::Fixed::toDouble(), and ipe::Text::width().
bool Latex::readPdf | ( | DataSource & | source | ) |
Read the PDF file created by Pdflatex.
Must have performed the call to Pdflatex, and pass the name of the resulting output file.
References ipe::PdfObj::array(), ipe::PdfResources::collect(), ipe::PdfDict::count(), ipe::PdfObj::dict(), ipe::PdfDict::get(), ipe::PdfDict::key(), ipe::PdfArray::obj(), ipe::PdfFile::page(), ipe::PdfFile::parse(), ipe::PdfObj::ref(), ipe::PdfResources::setIpeXForm(), ipe::PdfRef::value(), and ipe::PdfDict::value().
bool Latex::updateTextObjects | ( | ) |
Notify all text objects about their updated PDF code.
Returns true if successful.
References ipe::Text::XForm::iRefCount, and ipe::size().
Referenced by ipe::Document::completeLatexRun().
PdfResources * Latex::takeResources | ( | ) |
Return the newly created PdfResources and pass ownership to caller.
Referenced by ipe::Document::completeLatexRun().
|
friend |