Creation de fichier pdf

Soyez le premier à donner votre avis sur cette source.

Vue 15 119 fois - Téléchargée 1 561 fois

Description

Ce code montre comment créer un fichier PDF grâce à la librairie SFPDF que je développe également. C'est une version qui possède les fonctions de bases. Je poserai un peu plus tard une nouvelle librairie permettant de faire des trucs beaucoup plus fun avec le PDF.

Cette librairie à l'avantage d'être totalement indépendante.

Source / Exemple :


// ZIP

Conclusion :


Si jamais vous rencontrez des bugs n'hésitez pas à me le faire remonter. Cette librarie est encore en test et est sujet à plein de modification.

Codes Sources

A voir également

Ajouter un commentaire Commentaires
cs_Arnotic Messages postés 933 Date d'inscription dimanche 1 avril 2001 Statut Membre Dernière intervention 9 janvier 2012 1
2 nov. 2009 à 16:33
pour l'expérience scolaire je ne pense pas, j'ai arrêté les "études" à l'age de 16 ans pour partir dans le monde de l'entreprise.
Juniper62 Messages postés 1 Date d'inscription mercredi 26 septembre 2007 Statut Membre Dernière intervention 2 novembre 2009
2 nov. 2009 à 15:00
on voit bien que tu as l'expérience "scolaire" . L'usage des CSS est très utile et pas uniquement pour les applications web ou autre utilisant des scripts... dire que ça t'interesse pas est un manque d'ouverture ... les autres lib pdf proposent l'utilisation de css ... bref , ça n'apporte rien, encore moins en ne postant pas le source de la lib...
cs_dagosg Messages postés 10 Date d'inscription mardi 14 novembre 2000 Statut Membre Dernière intervention 12 juin 2008
12 juin 2008 à 12:31
pour virer la pub, j'fais des rectangles blancs en bas (cellules épaisses de bords blancs)
busagp Messages postés 6 Date d'inscription vendredi 12 août 2005 Statut Membre Dernière intervention 12 juin 2008
12 juin 2008 à 11:42
et en VB6, ça pourrait donner ça, sachant que les DWORD (non signé) sont traduit par des Long (signé) :

Public Type SFPDFPOS
dwX As Long
dwY As Long
dwW As Long
dwH As Long
dNewPage As Long
End Type

Public Declare Sub SFPDF_Init Lib "SFPDF.dll" (ByVal dwOrientation As Long)
Public Declare Function SFPDF_AddPage Lib "SFPDF.dll" () As Long
Public Declare Function SFPDF_Output Lib "SFPDF.dll" (ByVal FileName As String) As Long
Public Declare Function SFPDF_Cell Lib "SFPDF.dll" (ByVal dwX As Double, ByVal dwY As Double, ByVal dwW As Double, ByVal dwH As Double, ByVal dwL As Long, ByVal dwR As Long, ByVal dwT As Long, ByVal dwB As Long, ByVal dwFill As Long, ByVal dwAlign As Long, ByVal sTxt As String) As Long
Public Declare Function SFPDF_DrawColor Lib "SFPDF.dll" (ByVal dwR As Long, ByVal dwG As Long, ByVal dwB As Long) As Long
Public Declare Function SFPDF_DrawLine Lib "SFPDF.dll" (ByVal dwX1 As Long, ByVal dwY1 As Long, ByVal dwX2 As Long, ByVal dwY2 As Long) As Long
Public Declare Function SFPDF_FillColor Lib "SFPDF.dll" (ByVal dwR As Long, ByVal dwG As Long, ByVal dwB As Long) As Long
Public Declare Function SFPDF_GetHauteur Lib "SFPDF.dll" () As Long
Public Declare Function SFPDF_GetLargeur Lib "SFPDF.dll" () As Long
Public Declare Function SFPDF_Image Lib "SFPDF.dll" (ByVal FileName As String, ByVal dwX As Long, ByVal dwY As Long, ByVal dwW As Long, ByVal dwH As Long) As Long
Public Declare Function SFPDF_LineWidth Lib "SFPDF.dll" (ByVal dWidth As Double) As Long
Public Declare Function SFPDF_SetFont Lib "SFPDF.dll" (ByVal PoliceName As String, ByVal dwSize As Long) As Long
Public Declare Sub SFPDF_SetFontSize Lib "SFPDF.dll" (ByVal dwSize As Long)
Public Declare Function SFPDF_Text Lib "SFPDF.dll" (ByVal dwX As Long, ByVal dwY As Long, ByVal Texte As String) As Long
Public Declare Function SFPDF_TextColor Lib "SFPDF.dll" (ByVal dwR As Long, ByVal dwG As Long, ByVal dwB As Long) As Long
Public Declare Function SFPDF_TextFlow Lib "SFPDF.dll" (ByVal dwX As Long, ByVal dwY As Long, ByVal dwW As Long, ByVal dwH As Long, ByVal dwAlign As Long, ByVal Texte As String) As Long
Public Declare Sub SFPDF_SetBreakPageCallback Lib "SFPDF.dll" (ByVal dwAddr As Long)
Public Declare Function SFPDF_GetLargeurTexte Lib "SFPDF.dll" (ByVal Texte As String) As Double
gillardg Messages postés 3275 Date d'inscription jeudi 3 avril 2008 Statut Membre Dernière intervention 14 septembre 2014 2
12 juin 2008 à 09:56
normalement ça devrait être quelque chose comme ça :
Private Declare Function SFPDF_AddPage Lib "sfpdf.dll" Alias "SFPDF_AddPage" () As UInteger
Private Declare Function SFPDF_Cell Lib "sfpdf.dll" Alias "SFPDF_Cell" (ByVal dwX As Double, ByVal dwY As Double, ByVal dwW As Double, ByVal dwH As Double, ByVal dwL As UInteger, ByVal dwR As UInteger, ByVal dwT As UInteger, ByVal dwB As UInteger, ByVal dwFill As UInteger, ByVal dwAlign As UInteger, ByVal szTxt As System.IntPtr) As UInteger
Private Declare Function SFPDF_DrawColor Lib "sfpdf.dll" Alias "SFPDF_DrawColor" (ByVal dwR As UInteger, ByVal dwG As UInteger, ByVal dwB As UInteger) As UInteger
Private Declare Function SFPDF_DrawLine Lib "sfpdf.dll" Alias "SFPDF_DrawLine" (ByVal dwX1 As UInteger, ByVal dwY1 As UInteger, ByVal dwX2 As UInteger, ByVal dwY2 As UInteger) As UInteger
Private Declare Function SFPDF_FillColor Lib "sfpdf.dll" Alias "SFPDF_FillColor" (ByVal dwR As UInteger, ByVal dwG As UInteger, ByVal dwB As UInteger) As UInteger
Private Declare Function SFPDF_GetHauteur Lib "sfpdf.dll" Alias "SFPDF_GetHauteur" () As UInteger
Private Declare Function SFPDF_GetLargeur Lib "sfpdf.dll" Alias "SFPDF_GetLargeur" () As UInteger
Private Declare Function SFPDF_Image Lib "sfpdf.dll" Alias "SFPDF_Image" (ByVal szFile As System.IntPtr, ByVal dwX As UInteger, ByVal dwY As UInteger, ByVal dwW As UInteger, ByVal dwH As UInteger) As UInteger
Private Declare Function SFPDF_Init Lib "sfpdf.dll" Alias "SFPDF_Init" (ByVal dwOrientation As UInteger)
Private Declare Function SFPDF_LineWidth Lib "sfpdf.dll" Alias "SFPDF_LineWidth" (ByVal dWidth As Double) As UInteger
Private Declare Function SFPDF_Output Lib "sfpdf.dll" Alias "SFPDF_Output" (ByVal szFile As System.IntPtr) As UInteger
Private Declare Function SFPDF_SetFont Lib "sfpdf.dll" Alias "SFPDF_SetFont" (ByVal szPolice As System.IntPtr, ByVal dwSize As UInteger) As UInteger
Private Declare Function SFPDF_SetFontSize Lib "sfpdf.dll" Alias "SFPDF_SetFontSize" (ByVal dwSize As UInteger)
Private Declare Function SFPDF_Text Lib "sfpdf.dll" Alias "SFPDF_Text" (ByVal dwX As Integer, ByVal dwY As Integer, ByVal szTxt As System.IntPtr) As UInteger
Private Declare Function SFPDF_TextColor Lib "sfpdf.dll" Alias "SFPDF_TextColor" (ByVal dwR As UInteger, ByVal dwG As UInteger, ByVal dwB As UInteger) As UInteger
Private Declare Function SFPDF_TextFlow Lib "sfpdf.dll" Alias "SFPDF_TextFlow" (ByVal dwX As Integer, ByVal dwY As Integer, ByVal dwW As UInteger, ByVal dwH As UInteger, ByVal dwAlign As UInteger, ByVal szTxt As System.IntPtr) As UInteger
Private Declare Function SFPDF_SetBreakPageCallback Lib "sfpdf.dll" Alias "SFPDF_SetBreakPageCallback" (ByVal dwAddr As UInteger)
Private Declare Function SFPDF_GetLargeurTexte Lib "sfpdf.dll" Alias "SFPDF_GetLargeurTexte" (ByVal szTxt As System.IntPtr) As Double


Public Structure SFPDFPOS

'''DWORD->unsigned int
Public dwX As UInteger

'''DWORD->unsigned int
Public dwY As UInteger

'''DWORD->unsigned int
Public dwW As UInteger

'''DWORD->unsigned int
Public dwH As UInteger

'''DWORD->unsigned int
Public dNewPage As UInteger
End Structure

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.