You are not logged in.
Pages: 1
Sorry for my ignorance .
I tried with my pdf outputs and it worked. I don't know anything about pdf headers.
In which revision did it appear?
I changed my local copy. I did not upload any source code change. May be you can apply change to next revision.
Perhaps this would need to change the pdf format header.
As I see, these two little line of change is enough.
TPdfPageLayout implemented is like this:
TPdfPageLayout = (plSinglePage, plOneColumn, plTwoColumnLeft, plTwoColumnRight);
But I realize that Acrobat has two additional page layout which I need:
TwoPageLeft and TwoPageRight
so I changed two lines of code like this:
TPdfPageLayout = (
plSinglePage, plOneColumn, plTwoColumnLeft, plTwoColumnRight, plTwoPageLeft,
plTwoPageRight);
...
PDF_PAGE_LAYOUT_NAMES: array[TPdfPageLayout] of PDFString = (
'SinglePage', 'OneColumn', 'TwoColumnLeft', 'TwoColumnRight', 'TwoPageLeft',
'TwoPageRight');
I hope that it helps to someone.
Best Regards...
Hi there;
I want to add some extra color separations beside RGB and CMYK like PANTONE 151C. I found that fpdf.php can do this. I inspected the PDF file generated by fpdf and there is an object like below:
...
5 0 obj
[/Separation /PANTONE#20151#20C
/DeviceCMYK <<
/Range [0 1 0 1 0 1 0 1] /C0 [0 0 0 0]
/C1 [0.000 0.650 1.000 0.000]
/FunctionType 2 /Domain [0 1] /N 1>>]
endobj
...
I made some modifications in synpdf.pas and I could generate the result below:
...
10 0 obj
<<
/Length 0
/Separation PANTONE#20151#20C
/DeviceCMYK <<
/Range [0 1 0 1 0 1 0 1] /C0 [0 0 0 0]
/C1 [0.000 0.650 1.000 0.000 ]
/FunctionType 2 /Domain [0 1] /N 1>>]
>>
stream
endstream
endobj
...
As you can see I have some problems to choise correct functions to produce exactly same object. For example I can not add bracket ([) before (/Separation). Also I have some garbage fields like << and stream. If some one can help, I will be very pleased. Best Regards...
I mixed of them for two reasons:
I have to use CMYK colors and transparent PNG. Is it possible to use these with VCLCanvas?
I don't have to use kerning. If I can get unicode text width by PdfCanvas, it is enaugh for me.
You can download the test application from here (I updated the demo just now). What I do is:
Get the text width by TextExtent (for ex. to variable TxtWidth)
Calculate the text's left value by removing TxtWidth from rectangle's right side
Draw bounding rectangle for testing. I expect that text will fit in the bounding rectangle but the text always overflows bounding rectangle
Overflow amount depends on text content (not character count) and font (in demo app I used Times New Roman and Arial)
Hi;
I am working on text alignment (left, right, center etc). You can download sample application from here.
I can not succeed on getting exact text width. Depending on font size, real text width differs from VCLCanvas.TextExtent().cx result.
If you try different font sizes (12, 14, 16, 18, 20, 22 etc.) by changing xFontSize constant, you will see strange results.
Thanks for your help. Best Regards...
Hi;
I worked on adding transparent PNG to PDF for couple of days and I found that php library fpdf can do this. So I translated the php code to Delphi. You can download first demo application from here. I just worked on 32bits PNG images. The code uses a grayscale image for defining pixel transparency. But I have two problems:
I can't extract Alpha channel from PNG directly. First load PNG image than I need to reload for extracting alpha. So it is not very effective.
If I use a grayscale BMP as a mask image, it is ok. But if I use a grayscale PNG as a mask image, the are some problematic pixels. I think grayscale PNG loading function has a problem..
If someone can help I will be very pleased...
Is there a function like MultilineTextRect which supports Unicode?
One possibility could be to create a wide bitmap including transparent bitmaps drawn over it, computed as a TBitmap using the VCL or Windows API, then draw it in the PDF with the text over it.
Another workaround could be to create a region around your bitmap content, then use it as clipping mask. It should work.
How can I achieve clipping with pdfimage? If someone can give a sample code for pdf, I will be very pleased.
Thanks for the reply. What about CMYK stroke and fill colors?
Eureka. I added two functions to TPdfCanvas:
procedure TPdfCanvas.SetCMYKFillColor(C, M, Y, K: Byte);
begin
if FContents<>nil then
FContents.Writer.AddWithSpace(C/100).AddWithSpace(M/100).AddWithSpace(Y/100).AddWithSpace(K/100).Add('k'#10);
end;
procedure TPdfCanvas.SetCMYKStrokeColor(C, M, Y, K: Byte);
begin
if FContents<>nil then
FContents.Writer.AddWithSpace(C/100).AddWithSpace(M/100).AddWithSpace(Y/100).AddWithSpace(K/100).Add('K'#10);
end;
Hi;
First of all, this is a great component. I am new at this component but I have two problem:
1. I am using transparent PNG files but when I add these files to PDF, transparency disappear. Did I do something wrong or there is not transparent PNG support.
2. Is it possible to use CMYK colors and images instead of RGB?
Thanks for your help. Best Regards...
Pages: 1