It is currently Wed Sep 18, 2019 9:07 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Thu Jun 27, 2019 12:12 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 819
Location: Cuernavaca, Mexico
Thanks Thorsten,

I'm struggling to find out why "pbPDF-Watermark.pb" does NOT display the watermark, when I run the program.

Latest Win 10 Pro and PB 5.71 B2 (x86).

Tried 3 different PDF viewers, in case they might be the issue.

Perhaps you have an idea? :?:

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Thu Jun 27, 2019 12:52 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
BugFix: pbPDF-Watermark.pb

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Thu Jun 27, 2019 12:56 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 819
Location: Cuernavaca, Mexico
Thanks Thorsten, it's appreciated. 8)

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Fri Aug 09, 2019 4:05 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:34 pm
Posts: 904
Location: Canada
Very nice Module.

Would you be able to give a small example of how to properly use PDF::ImageMemory with PNG image that is included in a file?
My attempts just crash on line 2284 with "MemoryID is not valid"

_________________
Image Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Sun Aug 11, 2019 4:48 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
I tested that.
Apparently there is only the image content in the memory and not the header.
Unfortunately it is not possible to evaluate the header and insert the image into the PDF.

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Sun Aug 11, 2019 7:52 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:34 pm
Posts: 904
Location: Canada
Ok, so PDF::ImageMemory doesn't work :(

I then tried with PDF::Image and unfortunately that also causes problems.
If I have an image in a header and there is more that 1 page in the PDF, the PDF that is generated is corrupt.
(I can view the first page but if I scroll to the second page Adobe Reader gives error)

Try this code with an image of your choice...
Code:
#PDF=1
pdf$="test.pdf"
XIncludeFile "pbPDFModule.pbi"

Procedure Header()
  PDF::Image(#PDF, "logo.jpg",5,8,30,0)
  PDF::SetFont(#PDF, "Arial","B", 16)
  PDF::SetPosY(#PDF, 10)
  PDF::SetPosX(#PDF, 35)
  PDF::Cell(#PDF, "Test Page", 100, 16)     
  PDF::Ln(#PDF, 20)       
EndProcedure


If PDF::Create(#PDF,PDF::#Landscape,"mm",PDF::#Format_Letter)
  PDF::SetPageCompression(#PDF, #True)
  PDF::SetViewerPreferences(#PDF, PDF::#FitWindow)

  PDF::SetHeaderProcedure(#PDF,@Header())
  PDF::Enableheader(#PDF, #True) 
  PDF::AddPage(#PDF)
 
  For tmp=1 To 60
    PDF::Cell(#PDF, "This is a test"+Str(tmp), 100, 5, #False)
    PDF::Ln(#PDF)                               
  Next
       
  PDF::Close(#PDF, pdf$)   
  RunProgram(pdf$)
EndIf

_________________
Image Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Sat Aug 24, 2019 11:16 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:34 pm
Posts: 904
Location: Canada
Thorsten, would you be able to take a look at this?
This module would be very useful if you could get images in the header working properly.

_________________
Image Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Sat Aug 24, 2019 11:46 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 215
Location: Germany
Wow.
This is going to be a bunch of work to learn all these new commands, but this is 100x better than trying to create a PDF from scratch.
Thanks a TON for this Module!!! :)


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] pbPDF-Module
PostPosted: Mon Aug 26, 2019 10:42 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 892
Location: Germany
Paul wrote:
I then tried with PDF::Image and unfortunately that also causes problems.
If I have an image in a header and there is more that 1 page in the PDF, the PDF that is generated is corrupt.
(I can view the first page but if I scroll to the second page Adobe Reader gives error)

It was a little complicated to find the bug, but here it is:

Code:
11 0 obj
<</Length 359>>
stream
2 J
0.57 w
BT /F2 12.00 Tf ET
q 85.04 0 0 NaN 14.17 NaN cm /I1 Do Q
BT /F1 16.00 Tf ET
BT 102.05 556.18 Td (Test Page) Tj ET
BT /F2 12.00 Tf ET
BT 31.18 516.27 Td (This is a test1) Tj ET
endstream
endobj


Bugfix: PDF::Image()

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 15 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