mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
ide: PDF export in .qtf designer
This commit is contained in:
parent
c402c6b7a0
commit
e72b5bd4fb
6 changed files with 230 additions and 243 deletions
|
|
@ -107,6 +107,8 @@ bool HasGit();
|
|||
|
||||
int MaxAscent(Font f);
|
||||
|
||||
void ExportPdf(const RichEdit& editor);
|
||||
|
||||
String LibClangCommandLine();
|
||||
String LibClangCommandLineC();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Common.h"
|
||||
#include <PdfDraw/PdfDraw.h>
|
||||
|
||||
bool Debugger::Tip(const String&, CodeEditor::MouseTip&)
|
||||
{
|
||||
|
|
@ -264,3 +265,17 @@ int MaxAscent(Font f)
|
|||
return max(f.GetAscent(), f().Bold().GetAscent(),
|
||||
f().Italic().GetAscent(), f().Bold().Italic().GetAscent());
|
||||
}
|
||||
|
||||
void ExportPdf(const RichEdit& editor)
|
||||
{
|
||||
FileSel fs;
|
||||
fs.Type("PDF files", "*.pdf")
|
||||
.AllFilesType()
|
||||
.DefaultExt("pdf");
|
||||
if(!fs.ExecuteSaveAs("Output PDF file"))
|
||||
return;
|
||||
Size page = Size(3968, 6074);
|
||||
PdfDraw pdf(page + 400);
|
||||
::Print(pdf, editor.Get(), page);
|
||||
SaveFile(~fs, pdf.Finish());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue