It is currently Wed May 22, 2013 7:30 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 299 posts ]  Go to page Previous  1 ... 16, 17, 18, 19, 20  Next
Author Message
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Jun 10, 2012 3:04 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2860
Location: Wales, UK
:cry: Still not working here:
Code:
dPtcm.d = ((1/72) * 25.4)
   dW.d = 794.00 * dPtcm
   dH.d = 1123.00 * dPtcm
sPDF_PAGE_FORMAT_CUSTOM.s = StrD(dW,2) + "," + StrD(dH,2)

;Debug sPDF_PAGE_FORMAT_CUSTOM

Define   sPdfName.s = "C:\TestA4Format200dpi.pdf"
Define sImageFile.s = "TestA4Format200dpi.png"

      pdf_Create("P","pt",sPDF_PAGE_FORMAT_CUSTOM)
     pdf_AddPage()
       pdf_Image(sImageFile,0,0,dW)
        pdf_Save(sPdfName)

      ;View PDF created
      RunProgram(sPdfName)

No image and PDF Page Size is 98.8 x 139.8mm (Adobe Reader v10.1.3)

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Jun 10, 2012 10:01 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
What are the dimensions (in pixels) of your image IdeasVacuum ?

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Jun 10, 2012 3:51 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2860
Location: Wales, UK
Hi ABBKlaus, the 200dpi image is size A4, verifies as 794 x 1123 pix in Irfan View (and the OS explorer).

The files we have been testing are available for download:

Test Files

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Jun 10, 2012 5:50 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
If you want the PDF size equal to 210 x 297 mm you can do it this way :

Code:
ptinch.d=1/72 ; each point is ~0.014" (1/72 of an inch)
ptcm.d=(1/72)*25.4 ; each point is ~0.35 mm
ptx=210 / ptcm ; calculate 210 mm into point
pty=297 / ptcm ; calculate 297 mm into point
PDF_PAGE_FORMAT_CUSTOM.s=Str(ptx)+","+Str(pty)
sPdfName.s = "TestA4Format200dpi.pdf"
sImageFile.s = "TestA4Format200dpi.png"

pdf_Create("P","pt",PDF_PAGE_FORMAT_CUSTOM)
pdf_SetMargins(0,0,0)
pdf_SetFillColor(230,230,230) ;Light Gray
pdf_AddPage()
pdf_Image(sImageFile,0,0,ptx,pty)

pdf_Save(sPdfName)

;View PDF created
RunProgram(sPdfName)

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Jun 10, 2012 10:31 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2860
Location: Wales, UK
Oh yes, that works perfectly! :mrgreen:

Thanks again ABBKlaus

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Jun 12, 2012 11:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jan 12, 2009 10:33 am
Posts: 274
Is there any way I can change the PDF Producer tag with my own text. I know it's not meant to be changed but the files produced by my application are sent to clients and we need to put our company's credentials in there. Thanks.

_________________
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 7 HP (x64), DirectX 11, PureBasic 5.11 (x86)


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Jun 19, 2012 1:49 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
Can I request that PurePDF support passwords for opening the created PDF document in future? Thanks! (And I mean natively, and not with a JavaScript hack).

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Jul 18, 2012 2:31 pm 
Offline
User
User

Joined: Thu Jan 05, 2012 12:27 am
Posts: 45
I just downloaded the PurePDF lib and tested all tutorials, what a nice package -- thanks :wink:

I started "decoding" some HTML-Tags (<b>, </b> and <br>), which can be seen in the code below. But I would need a kind of a text flow and have no idea how to do this. I have an image on the top right position of a page and a loto of text which should be drawn on the page (except over the image).

It should look like that (t=text, *=image):
__________

tt ttttt . ******
ttttt tt . ******
tt ttttt . ******
ttttt tt
ttttt ttttt tttttt
tt tt ttt tttt ttt
tttttt
__________

Can this be done easily?

I have also another problem, some jpg files are not displayed in the resulting pdf file. PB is able to display these images with no problem and as there are no big differences in the jpg parameters (image size, DPI etc.) it seems to be that progressive encoding is not supported.
As I am not able to change the image sources, is it possible to do a trick do embed these jpg files into a pdf file without creating temporary files for each image?

Code:
   Procedure WriteText(Text.s)

      Protected FlagBoldOn
      Protected FlagBoldOff
      Protected FlagBreak

      Repeat
         FlagBreak=FindString(Text,"<br>",FlagBreak)
         If FlagBreak
            WriteText(Left(Text,FlagBreak-1))
            Text=Trim(Mid(Text,FlagBreak+4))
            If Len(Text)
               WriteText(Text)
            EndIf
            Break
         EndIf

         FlagBoldOn=FindString(Text,"<b>",FlagBoldOff)

         If FlagBoldOn

            pdf_Write(5,Left(Text,FindString(Text,"<b>",1) - 1))

            FlagBoldOff=FindString(Text,"</b>",FlagBoldOn)
            If FlagBoldOff=0
               FlagBoldOff=Len(Text)
            EndIf
            pdf_SetFont(#FontFace,"B",14)
            pdf_Write(5,Mid(Text,FlagBoldOn+3,FlagBoldOff-FlagBoldOn-3))
            pdf_SetFont(#FontFace,"",12)
            FlagBoldOff+4

         Else

            pdf_Write(5,Mid(Text,FlagBoldOff))
            pdf_Ln()
            Break

         EndIf

      ForEver

   EndProcedure



Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Aug 01, 2012 3:23 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 31, 2006 4:34 am
Posts: 427
Removed this question and transfered this post to the Coding Questions section
where ABBKlaus was able to help me.
Thanks for providing this nice library. :D

yrreti


Last edited by yrreti on Thu Aug 02, 2012 7:15 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Aug 01, 2012 3:46 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:34 pm
Posts: 758
Location: Canada
Is this PurePDF tool able to load a PDF file, make some additions and then resave as PDF ?
If not, does anyone know of some existing code or command line tool to do this?

Thanks.

_________________
Image Image


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Aug 01, 2012 11:21 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2860
Location: Wales, UK
It is currently used to create PDF files. You can do more with GhostScript, but for commercial use the license could be an issue. I made an inquiry not so long ago and decided not to bother when I received a reply consisting of a long list of questions.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Aug 28, 2012 6:24 am 
Offline
User
User

Joined: Thu Sep 30, 2010 6:40 am
Posts: 27
ABBKlaus wrote:
Update :
- added WMF support (requested by Oliver13)

Hi Klaus,
I haven't been here for a while: thank you very much !!!

Oliver


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Jan 29, 2013 2:42 pm 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 26, 2003 1:11 am
Posts: 1300
i need a simple JPEG/PNG 2 PDf converter ,
i remembered this thread, donwloaded the stuff and
voila, it did not work with 5.10 .
Code:
Procedure MEM_DataReplace(*aData.MEM_DataStructure, aSource.s, aDest.s)
.
.
.
  If (vFind > 0)
      vReturn = MEM_DataInit(*aData, vMaxSize + (vFind*(vDestLen - vSourceLen))) = #False
    EndIf 

throws a boolean error .
normaly, i'm able to fix such errors bymyself, but i'm totaly lost in this case.
And yes, i never would type such a construct ;)
anyone can help me (and the community) to fix that errors in the lib ?

_________________
SPAMINATOR NR.1


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Jan 29, 2013 3:44 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 1441
Location: Germany
Hi Rings,

to be backward compatible I would do it like this:
Code:
If (vFind > 0)
  If MEM_DataInit(*aData, vMaxSize + (vFind*(vDestLen - vSourceLen))) = #False
    vReturn = #True
  Else
    vReturn = #False
  EndIf
EndIf

I hope that's right.

Bernd


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Jan 30, 2013 8:13 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
Thanks for reporting Rings and infratec.

I have uploaded fixed archives (no version change) ;-)

http://www.purebasicpower.de/?PurePDF

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 299 posts ]  Go to page Previous  1 ... 16, 17, 18, 19, 20  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye