Funny you should ask.. I just finished my PDF portion.. Heres what I did..
Since there really isnt a report writer for IOS.. I send the Invoice number to my Server, it generates my PDF.. then I download it and display.. Then I can print on an airprint server.. Works perfect. Takes about 3 seconds..
I did have trouble taking snapshops of views, and making PDF's.. I couldnt get my report to look right, so I let the server do the work in this case..
Not sure what Id do if I didnt have internet..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Gordon
I am also thinking about this way too. However, i don't like to have a windows as the client to generate the PDF. I am thinking of using linux but which part of linux can i use to work with Delphi or Lazarus?
Currently i am using fast report to generate reports on windows xp but i thinking of shifting it to linux.
What would be your advise
thanks
chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For my App I also considered to use an external server for PDF printing, because sometimes I needed more than one page and the current DPF implementation of PDF print didn´t allow this. For me was a MUST not requiring an internet connection, so I created a new PDF Export function:
In the UIVIew I want to print, I put a UITableView with fixed RowHeight. In my particular case, I wanted 4 rows/PDF page (I put charts in there).
So what I do, is to capture this view, then I scroll the TableView to the next 4 rows and so...
functionTfResultados.CreatePDFfromViewCustom2(aView: UIView;FileName: string;Tabla: TDPFUiTableView):Boolean;varpdfData : NSMutableData;pdfContext: CGContextRef;i,paginas: Integer;AuxBounds: NSRect;beginAuxBounds:=aView.bounds;result:=false;uiFondoResultados.Align:=TAlignLayout.alNone;//Fixed iPad sizesuiFondoResultados.Width:=768;uiFondoResultados.Height:=955+64;FondoTitulo.Width:=uiFondoResultados.Width;//if not an iPad, I change the size of the uiview before printingif(NOTfMenu.vEsiPAD)thenAjustarVistaParaImpresion(true);FondoTitulo.Visible:=true;iffrac(Tabla.Sections.Count/4)>0thenbeginpaginas:=trunc(Tabla.Sections.Count/4)+1;endelsepaginas:=round(Tabla.Sections.Count/4);// Creates a mutable data object for updating with binary data, like a byte arraypdfData:=TNSMutableData.Create;// Points the pdf converter to the mutable data object and to the UIView to be convertedUIGraphicsBeginPDFContextToData((pdfDataasILocalObject).GetObjectID,uiFondoResultados.GetUIView.bounds,nil);fori:=0topaginas-1dobeginTabla.ScrollToRow(i*4,0,spTop,false);UIGraphicsBeginPDFPage();pdfContext:=UIGraphicsGetCurrentContext();// draws rect to the view and thus this is captured by UIGraphicsBeginPDFContextToDataifi=0thenbeginuiFondoResultados.GetUIView.layer.renderInContext(pdfContext);FondoTitulo.Visible:=false;endelseaView.layer.renderInContext(pdfContext);end;// remove PDF rendering contextUIGraphicsEndPDFContext();RemoveFile(FileName);ifpdfData.length>0thenresult:=pdfData.writeToFile(NSStr(FileName),false);pdfData.release;uiFondoResultados.Align:=TAlignLayout.alClient;if(NOTfMenu.vEsiPAD)thenAjustarVistaParaImpresion(False);//I restore the original Bounds of the UIVIew aView.setBounds(AuxBounds);Tabla.ScrollToRow(0,0,spTop,false);end;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
is there a component that i can use to read PDF file for iOS?
please advise
thanks
chris
Check the PDF demos...
Last edit: Diego 2014-06-12
Funny you should ask.. I just finished my PDF portion.. Heres what I did..
Since there really isnt a report writer for IOS.. I send the Invoice number to my Server, it generates my PDF.. then I download it and display.. Then I can print on an airprint server.. Works perfect. Takes about 3 seconds..
I did have trouble taking snapshops of views, and making PDF's.. I couldnt get my report to look right, so I let the server do the work in this case..
Not sure what Id do if I didnt have internet..
Hi Gordon
I am also thinking about this way too. However, i don't like to have a windows as the client to generate the PDF. I am thinking of using linux but which part of linux can i use to work with Delphi or Lazarus?
Currently i am using fast report to generate reports on windows xp but i thinking of shifting it to linux.
What would be your advise
thanks
chris
For my App I also considered to use an external server for PDF printing, because sometimes I needed more than one page and the current DPF implementation of PDF print didn´t allow this. For me was a MUST not requiring an internet connection, so I created a new PDF Export function:
In the UIVIew I want to print, I put a UITableView with fixed RowHeight. In my particular case, I wanted 4 rows/PDF page (I put charts in there).
So what I do, is to capture this view, then I scroll the TableView to the next 4 rows and so...