Commit 34a881c4 authored by BORNON Théophile's avatar BORNON Théophile

First commit

parent eaaff171

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDF_fill", "PDF_fill\PDF_fill.csproj", "{9567E78B-0224-43B2-BB06-09602E9EE798}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9567E78B-0224-43B2-BB06-09602E9EE798}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9567E78B-0224-43B2-BB06-09602E9EE798}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9567E78B-0224-43B2-BB06-09602E9EE798}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9567E78B-0224-43B2-BB06-09602E9EE798}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {44D09B47-C599-498C-AE0F-A1E4E2A007AF}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PDF_fill
{
public class Personne
{
public string Nom;
public string Prenom;
public string NumSecu;
public string DateNaissance;
public string LieuNaissance;
public string CPNaissance;
public string Profession;
public string Adresse;
public string Ville;
public string CP;
public bool CI;
public string NumeroID;
public string DateDelivrance;
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9567E78B-0224-43B2-BB06-09602E9EE798}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>PDF_fill</RootNamespace>
<AssemblyName>PDF_fill</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Element.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Text.RegularExpressions;
using System.Drawing;
namespace PDF_fill
{
public class Program
{
public static List<Personne> Personnes = new List<Personne>();
public static void Main(string[] args)
{
//Personnes = ChargerPersonnes();
Bitmap doc = new Bitmap("demande.bmp");
RectangleF nomLocation = new RectangleF(200, 1055, 1050,100);
RectangleF prenomLocation = new RectangleF(1500, 1055, 800,100);
RectangleF SSLocation = new RectangleF(1545, 1145, 700,100);
using (Graphics g = Graphics.FromImage(doc))
{
using (Font arialFont = new Font("Arial", 10))
{
g.DrawString("Test 1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23", arialFont, Brushes.Blue, nomLocation);
g.DrawString("Test 456", arialFont, Brushes.Blue, prenomLocation);
}
using (Font arialFont = new Font("Arial", 18))
{
g.DrawString("2.87.03.84.007.197", arialFont, Brushes.Blue, SSLocation);
}
}
doc.Save("test.bmp");
foreach (Personne p in Personnes)
{
Console.WriteLine("{0} - {1} : {2}", p.Nom, p.Prenom, p.NumSecu);
}
Console.Read();
}
public static List<Personne> ChargerPersonnes()
{
string[] entrees = File.ReadAllLines("data.csv");
List<Personne> Personnes = new List<Personne>();
Personne _p;
string[] infos;
foreach (string entree in entrees)
{
infos = entree.Split(';');
_p = new Personne();
_p.Nom = infos[0];
_p.Prenom = infos[1];
_p.DateNaissance = DateTime.FromOADate(int.Parse(infos[7])).ToShortDateString();
_p.LieuNaissance = infos[8];
_p.CPNaissance = infos[9];
_p.NumSecu = infos[10];
_p.Profession = infos[16];
Regex rgxAdresse = new Regex(@"-\s+(\d){5}.*");
Regex rgxCP = new Regex(@"(\d){5}");
Regex rgxVille = new Regex(@".*(\d){5}\s+");
_p.Adresse = rgxAdresse.Replace(infos[11], "");
_p.CP = rgxCP.Match(infos[11]).Groups[0].ToString();
_p.Ville = rgxVille.Replace(infos[11], "");
Personnes.Add(_p);
}
return Personnes;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("PDF_fill")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PDF_fill")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("9567e78b-0224-43b2-bb06-09602e9ee798")]
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment