This commit is contained in:
Oleg.Korshul
2020-12-01 00:39:10 +03:00
parent 3ec8dc1960
commit 3bca2b1ae9
33 changed files with 4201 additions and 2528 deletions

View File

@ -62,8 +62,7 @@ int main(int argc, char *argv[])
#else
std::string sParam(argv[i]);
#endif
if (sParam == "-v" ||
sParam == "-version")
if (sParam == "-v" || sParam == "-version")
{
std::cout << "v" VALUE(INTVER) << std::endl;
NSDoctRenderer::CDocBuilder oBuilder;
@ -101,8 +100,6 @@ int main(int argc, char *argv[])
std::wstring sBuildFile = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sBuildFileA.c_str(), (LONG)sBuildFileA.length());
#endif
NSDoctRenderer::CDocBuilder::Initialize();
if (true)
{
NSDoctRenderer::CDocBuilder oBuilder;
@ -140,7 +137,5 @@ int main(int argc, char *argv[])
oBuilder.Run(sBuildFile.c_str());
}
NSDoctRenderer::CDocBuilder::Dispose();
return 0;
}

View File

@ -0,0 +1,33 @@
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oRun;
oParagraph = oDocument.GetElement(0);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Dear John Smith.");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("ONLYOFFICE is glad to announce that starting today, you are appointed Commercial director to the company of your dream.");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oRun = Api.CreateRun();
oRun.SetBold(true);
oRun.AddText("Please note: ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.AddText("this text is used to demonstrate the possibilities of ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetBold(true);
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.AddText(" and cannot be used as real appointment to the position in any real company.");
oParagraph.AddElement(oRun);
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Best regards,");
oParagraph.AddLineBreak();
oParagraph.AddText("ONLYOFFICE Document Builder Team");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "SampleText.docx");
builder.CloseFile();