zertovitch / ada-pdf-writer Goto Github PK
View Code? Open in Web Editor NEWAda PDF Writer: a standalone, portable package for producing dynamically PDF documents
Home Page: https://apdf.sourceforge.io/
Ada PDF Writer: a standalone, portable package for producing dynamically PDF documents
Home Page: https://apdf.sourceforge.io/
The link http://joinadanow.com/#mascot
leads to a website with adult content.
It is mentioned in demo/pdf_out_demo.adb
I noticed at a time when switching to new compiler that the pdf file got much bigger. The reason was incredible high precision caused by the following line.
Line 92 in 5c2322f
Hi,
it seems to me that for a very small cost, it is possible to use ISO-8859-1 characters.
pdf.put_Line_wws ("J'adore les caractères accentués:");
for i in 199 .. 207 loop
pdf.put_wws ("" & Wide_Wide_Character'Val (i));
end loop;
of the Small_demo procedure from the pdf_out_demo.adb file:
procedure Small_demo is
pdf : PDF_Out_File;
begin
pdf.Create ("Small.pdf");
pdf.Page_Setup (A4_portrait);
pdf.Put_Line ("This is a small demo for PDF_Out.");
pdf.put_Line_wws ("J'adore les caractères accentués:");
for i in 199 .. 207 loop
pdf.put_wws ("" & Wide_Wide_Character'Val (i));
end loop;
pdf.New_Line;
pdf.Put ("If you like numbers, here are some: ");
for i in 1 .. 10 loop
pdf.Put (i);
pdf.Put ("... ");
end loop;
pdf.New_Line;
for i in 1 .. 10 loop
pdf.Put (Real (i) * 0.123_4, 3, 4, 0);
end loop;
pdf.New_Line;
pdf.Put_Line ('[' & Img (3.141_59) & ']');
pdf.Put_Line ('[' & Img (3.141_592_653) & ']');
pdf.Put ("Fun, isn't it ?");
pdf.Page_Setup (A4_landscape);
pdf.New_Page;
pdf.Put_Line ("Just had a page break (and switched to landscape)...");
pdf.Close;
end Small_demo;
I have modified the pdf_out.ads file:
with Ada.Strings.Wide_Wide_Unbounded; use Ada.Strings.Wide_Wide_Unbounded;
[...]
procedure put_wws (pdf : in out PDF_Out_Stream; ww_str : Wide_Wide_String);
procedure put_Line_wws
(pdf : in out PDF_Out_Stream; ww_str : Wide_Wide_String);
procedure put_Line_wws
(pdf : in out PDF_Out_Stream; ww_str : Unbounded_Wide_Wide_String);
I have modified the pdf_out.adb file:
with Ada.Characters.Conversions;
[...]
procedure put_wws(pdf:in out PDF_Out_Stream;ww_str:wide_wide_string) is
use ada.Characters.Conversions;
begin
put(pdf,to_string(ww_str));
end put_wws;
procedure put_Line_wws
(pdf : in out PDF_Out_Stream; ww_str : Wide_Wide_String)
is
use Ada.Characters.Conversions;
begin
Put_Line (pdf, To_String (ww_str));
end put_Line_wws;
procedure put_Line_wws
(pdf : in out PDF_Out_Stream; ww_str : Unbounded_Wide_Wide_String)
is
use Ada.Characters.Conversions;
begin
Put_Line (pdf, To_String (To_Wide_Wide_String (ww_str)));
end put_Line_wws;
Hi,
even if not all "pdf" options are implemented, apdf is very useful.
Some limitations are unexpected: recently, I searched for some time why a part of my page was not displayed: simply I had forgotten to close a parenthesis in a "STRING" expression when writing with "put_line".
Everything is back in order.
However, I can't open a parenthesis in a "put_line" entry and close it in another "put_line" entry without getting characters (I'm thinking here of the pdf translation) that are not expected.
I have summarised the situation in the code below:
-- gnatmake -P pdf_out_gnat.gpr demo.adb
-- ./demo
-- evince demo0?.pdf
with PDF_Out; use PDF_Out;
procedure demo is
pdf : PDF_Out_File;
begin
--- output one two (three) four five
pdf.Create ("demo01.pdf");
pdf.Page_Setup (A4_portrait);
pdf.put_line("one two (three) four five");
pdf.close;
--- output empty
pdf.Create ("demo02.pdf");
pdf.Page_Setup (A4_portrait);
pdf.put_line("one two (three four five");
pdf.close;
--- output empty
pdf.Create ("demo03.pdf");
pdf.Page_Setup (A4_portrait);
pdf.put_line("one two (three ");
pdf.put_line("four");
pdf.put_line("five");
pdf.close;
--- output "one two (three ) Tj T* (four) Tj T* (five)"
pdf.Create ("demo04.pdf");
pdf.Page_Setup (A4_portrait);
pdf.put_line("one two (three ");
pdf.put_line("four");
pdf.put_line("five)");
pdf.close;
end demo;
Hi,
Is it possible to have a line feed with ascii.lf or ascii.cr in the put_line procedure, for example ?
with PDF_Out;
procedure test2 is
use PDF_Out;
Doc : PDF_Out_File;
begin
Doc.Create ("my_pdf.pdf");
Doc.Page_Setup (A4_portrait);
Doc.put_line("Hello"&ascii.lf&"Bye.");
Doc.Close;
end test2;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.