[PB 5.72 x64]
Windows 10 x64
Hello,
For my sub program CAD / ELECTRIC SCHEMES drawing and first tests (see image below),
I want to export the screen drawing data to a PDF file ... MyFile.pdf
For that I want to use the pbPDFModule.pbi (thanks Thorsten1867)
or are there better solutions for [pb5.72x64] win 10 ?
Page : A4 = 297x210 mm
Form : Landscape
Color : Black/white
DrawingData : standard PB 2D Library
What is the best way to do this ?
1) export as lines, arcs, circles and text ...
2) pre-drawing all on a image and export as pdf image ...
Thanks,
marc
[PB 5.72 x64] - export to PDF question ...
[PB 5.72 x64] - export to PDF question ...
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
PS: sorry for my english I speak flemish ...
-
- Enthusiast
- Posts: 544
- Joined: Wed Sep 25, 2019 10:18 am
Re: [PB 5.72 x64] - export to PDF question ...
Try PB 6.10 Beta 6 Windows
PLC_Stuff.pdf
PLC_Stuff.pdf
Code: Select all
; PdfVectorOutput Windows PB 6.10 Beta 6
UsePNGImageDecoder()
UsePNGImageEncoder()
PLC=LoadImage(#PB_Any,"D:\PLC_Stuff.png")
If StartVectorDrawing(PdfVectorOutput("D:\PLC_Stuff.pdf",297,210,#PB_Unit_Millimeter))
MovePathCursor(0, 0)
DrawVectorImage(ImageID(PLC),$ff,297,210)
StopVectorDrawing()
EndIf
Re: [PB 5.72 x64] - export to PDF question ...
I think it would look nice if you created the image in memory then loaded the image to a page using pbPDF image from memory command:
Norm.
Code: Select all
;Definition
PDF::ImageMemory(ID.i, ImageName.s, *Memory, Size.i, Format.i, X.f=#PB_Default, Y.f=#PB_Default, Width.f=#PB_Default, Height.f=#PB_Default, Link.i=#NoLink)
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Re: [PB 5.72 x64] - export to PDF question ...
That is two method what you can do with CAD to PDF :
Method 1 :
Draw everything to a PNG/JPG image , and then use pbPDFModule.pbi to put/Embed the image inside the PDF and save.
This method will save the CAD as raster image and not good to enlarger print/view.
just to take care the pbPDFModule.pbi has some pros and cons
Method 2 :
Insert all the CAD entity/element (LINE/ARC/CIRCLE/TEXT/ELIPSE/POLYLINE/LWPOLYLINE...) as PDF path and stroke with color and lineweigth , this method will let you print sharp and clear CAD draw in larger format like A0 size without any problem.
but pbPDFModule.pbi can't do a real ARC function , because PDF native path use LINE and Bezier only.
i do need this CAD to PDF things , so i take Method 2 and modified large code from pbPDFModule.pbi , so far it is ok for me to draw path from CAD.
Method 1 :
Draw everything to a PNG/JPG image , and then use pbPDFModule.pbi to put/Embed the image inside the PDF and save.
This method will save the CAD as raster image and not good to enlarger print/view.
just to take care the pbPDFModule.pbi has some pros and cons
Method 2 :
Insert all the CAD entity/element (LINE/ARC/CIRCLE/TEXT/ELIPSE/POLYLINE/LWPOLYLINE...) as PDF path and stroke with color and lineweigth , this method will let you print sharp and clear CAD draw in larger format like A0 size without any problem.
but pbPDFModule.pbi can't do a real ARC function , because PDF native path use LINE and Bezier only.
i do need this CAD to PDF things , so i take Method 2 and modified large code from pbPDFModule.pbi , so far it is ok for me to draw path from CAD.
Re: [PB 5.72 x64] - export to PDF question ...
for Method 1 , the PDf file size is very big , normally 200K to 1M , 2M , depend on the raster image
for method 2 , the file size is small , normally is between 20K to 200K depend on drawing elements.
for method 2 , the file size is small , normally is between 20K to 200K depend on drawing elements.
Re: [PB 5.72 x64] - export to PDF question ...
and if you use Method 2 , just be careful , as the PDF (x,y) origin is at TOP LEFT , and CAD WCS coordinate origin (x,y) is at BOTTOM LEFT , so you have to mirror y axis , and some more you need to check the bounding box of CAD element and scale it to fit to PDF page size designated .
and you need to do some DTP point size to metrics mm size or vice versa , since PDF only use DTP point size for all length measurements.
and you need to do some DTP point size to metrics mm size or vice versa , since PDF only use DTP point size for all length measurements.
Re: [PB 5.72 x64] - export to PDF question ...
@juergenkulow
@normeus
Yes, I think I gone use that way ...
First create it locally and then export it as a png image.
@moricode
Thanks for your answers and tips,
I don't need to scale the PDF file drawing,
as it is always on a A4 page in landscape direction.
And it is Black/White.
And also 150 DPI is good an of for this CAD application -> pdf.
Thanks,
Marc
Sorry, but for me, PB5.72x64 is the best graphic compiler till today ...Try PB 6.10 Beta 6 Windows
@normeus
Yes, I think I gone use that way ...
First create it locally and then export it as a png image.
@moricode
Thanks for your answers and tips,
I don't need to scale the PDF file drawing,
as it is always on a A4 page in landscape direction.
And it is Black/White.
And also 150 DPI is good an of for this CAD application -> pdf.
Thanks,
Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
PS: sorry for my english I speak flemish ...