#![forbid(unsafe_code)]
#![warn(missing_docs)]
pub mod basic;
pub mod font;
pub mod page;
pub mod writer;
pub mod image;
use basic::*;
use font::*;
use page::*;
pub use writer::{html, Writer};
#[test]
fn image_test()
{
use crate::image::Image;
let mut w = Writer::default();
w.b.nocomp = true;
let mut data = Vec::new();
for i in 0..3 * 16 * 16 {
data.push( i as u8 ); data.push( ( i + 85 ) as u8 ); data.push( ( i + 85 + 85 ) as u8 ); }
let mut im = Image{ obj:0, data: &data, width:16, height:16, bits_per_component:8, color_space: b"/DeviceRGB", other: b"" };
im.init(&mut w.b);
html( &mut w, b"<p>Hello <b>there</b><p>Hello <i>again</i>" );
w.p.rect( 100.0, 200.0, 160.0, 100.0 );
im.draw( &mut w.p, 100.0, 300.0, 10.0 );
w.output_line();
w.save_page();
html( &mut w, b"<p>Some <b>more</b> text" );
w.finish();
use std::fs::File;
use std::io::prelude::*;
let mut file = File::create("image_test.pdf").unwrap();
file.write_all(&w.b.b).unwrap();
}
#[test]
fn image_jpg_test()
{
}