转自:http://blog.csdn.net/ant1239/article/details/7761676

本方法为项目中画pdf的一个方法,画pdf,一共分为几步,1,获取地址,有两种获取地址方法,这是其中一种,2,关联上下文后开始绘画pdf,开始新的一页后必须用cgcontentbeginpage方法开始新的一页,从新设置坐标,等属性。3,释放。pdf就是个画布,我们是往上面画东西,而不是写东西,还有就是pdf用的坐标系是数学坐标,左下角为原点,而不是编程里常用的左上角为为坐标原点~一下是源码,重复的东西有点多,懒得整理了~关键的就那么几句~

-(void)MyPDFContextCreate{

//获取路径

    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);坐标

    NSString *saveDirectory=[paths objectAtIndex:];

    NSString *saveFileName=@"myPDF.pdf";

    NSString *newFilePath=[saveDirectory stringByAppendingPathComponent:saveFileName];

    const char *filename=[newFilePath UTF8String];

//设置页面大小

    CGRect pageRect=CGRectMake(, , , );

//关联上下文的对象

    CGContextRef pdfContext;

    CFStringRef path;

    CFURLRef url;

    path=CFStringCreateWithCString(NULL, filename, kCFStringEncodingUTF8);

    url=CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, );

    CFRelease(path);

    pdfContext=CGPDFContextCreateWithURL(url, &pageRect, nil);

    CFRelease(url);

    //开始画pdf

    NSString *temtext=[[NSString alloc]init];

    const char *text=(char *)[temtext UTF8String];

    int  width;

    int height;

    // 画推荐信

    NSNumber *en=[self.fatherobject valueForKey:@"enabel"];

    if(en.boolValue){

        height=;

//开始画pdf,开始新的一页

        CGContextBeginPage(pdfContext, &pageRect);

//设置字体,字体大小等

        CGContextSelectFont(pdfContext, "Helvetica", , kCGEncodingMacRoman);

        CGContextSetTextDrawingMode(pdfContext, kCGTextFill);

        CGContextSetRGBFillColor(pdfContext, , , , );

        //画姓名

        if(self.firstname!=nil||self.lastname!=nil){

            if(self.firstname==nil){

                self.firstname=@"";

            }

            if(self.lastname==nil){

                self.lastname=@"";

            }

            temtext=[NSString stringWithFormat:@"%@ %@",self.firstname,self.lastname];

        }

        width=[self getfontwidth:temtext fontsize:];

        text=(char*)[temtext UTF8String];

        CGContextSetFontSize(pdfContext, );

//关键方法,在指定位置画上text文字,文字必须为char类型

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

        height=height-;

        if((self.street!=nil&&![self.street isEqualToString:@""])||

           (self.apt!=nil&&![self.apt isEqualToString:@""])||

           (self.city!=nil&&![self.city isEqualToString:@""])||

           (self.state!=nil&&![self.state isEqualToString:@""])||

           (self.zip!=nil&&![self.zip isEqualToString:@""])){

            if(self.street==nil){

                self.street=@"";

            }

            if(self.apt==nil){

                self.street=@"";

            }

            if(self.city==nil){

                self.city=@"";

            }

            if(self.state==nil){

                self.state=@"";

            }

            if(self.zip==nil){

                self.zip=@"";

            }

            temtext=[NSString stringWithFormat:@"%@,%@,%@,%@,%@",self.street,self.apt,self.city,self.state,self.zip];

            text=(char *)[temtext UTF8String];

            width=[self getfontwidth:temtext fontsize:];

            CGContextSetFontSize(pdfContext, );

            CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

            height=height-;

        }

        if(self.phone==nil){

            self.phone=@"";

        }

        if(self.fax==nil){

            self.fax=@"";

        }

        if(self.Email==nil){

            self.Email=@"";

        }

        if(self.website==nil){

            self.website=@"";

        }

        if(![self.phone isEqualToString:@""]||

           ![self.fax isEqualToString:@""]||

           ![self.Email isEqualToString:@""]||

           ![self.website isEqualToString:@""]){

            temtext=[NSString stringWithFormat:@"Phone:%@, Fax:%@, Email:%@, Website:%@",self.phone,self.fax,self.Email,self.website];

            text=(char *)[temtext UTF8String];

            width=[self getfontwidth:temtext fontsize:];

            CGContextSetFontSize(pdfContext, );

            CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

            height=height-;

        }

        //划线

        CGContextMoveToPoint(pdfContext, , height);

        CGContextAddLineToPoint(pdfContext, -, height);

        CGContextStrokePath(pdfContext);

        height=height-;

        //画cotterletter内容

        NSManagedObject *myobject=[DataController getcontactinfo:self.fatherid];

        NSString *myapt=[myobject valueForKey:@"apt"];  

        NSString *mycity=[myobject valueForKey:@"city"];

        NSString *mycompanyname=[myobject valueForKey:@"companyname"];

        NSString *myfirstname=[myobject valueForKey:@"firstname"];

        NSString *mylastname=[myobject valueForKey:@"lastname"];

        NSString *myposition=[myobject valueForKey:@"postion"];

        NSString *mystate=[myobject valueForKey:@"state"];

        NSString *mystreet=[myobject valueForKey:@"street"];

        NSString *mytitle=[myobject valueForKey:@"title"];

        NSString *myzip=[myobject valueForKey:@"zip"];

        NSDate *mydate=[myobject valueForKey:@"date"];

        if(mydate!=nil){

            NSDateFormatter *myformatter=[[NSDateFormatter alloc]init];

            [myformatter setDateFormat:@"MMMM, yyyy"];

            temtext=[NSString stringWithFormat:@"%@",[myformatter stringFromDate:mydate]];

            [myformatter release];

            text=(char *)[temtext UTF8String];

            CGContextSetFontSize(pdfContext, );

            CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

            height=height-;

        }

        if((mytitle!=nil&&![mytitle isEqualToString:@""])||

           (myfirstname!=nil&&![myfirstname isEqualToString:@""])||

           (mylastname!=nil&&![mylastname isEqualToString:@""])){

            temtext=[NSString stringWithFormat:@"%@ %@ %@",mytitle,myfirstname,mylastname];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

            height=height-;

        }

        if(myposition!=nil&&![myposition isEqualToString:@""]){

            temtext=[NSString stringWithFormat:@"%@",myposition];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

            height=height-;

        }

        if(mycompanyname!=nil&&![mycompanyname isEqualToString:@""]){

            temtext=[NSString stringWithFormat:@"%@",mycompanyname];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

            height=height-;

        }

        if((![myapt isEqualToString:@""]&&myapt!=nil)||

           (![mystreet isEqualToString:@""]&&mystreet!=nil)){

            temtext=[NSString stringWithFormat:@"%@.,%@",myapt,mystreet];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

            height=height-;

        }

        if((mycity!=nil&&![mycity isEqualToString:@""])||

           (mystate!=nil&&![mystate isEqualToString:@""])||

           (myzip!=nil&&![myzip isEqualToString:@""])){

            temtext=[NSString stringWithFormat:@"%@,%@,%@",mycity,mystate,myzip];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

            height=height-;

        }

        if((mytitle!=nil&&![mytitle isEqualToString:@""])||

           (mylastname!=nil&&![mylastname isEqualToString:@""])){

            height=height-;

            temtext=[NSString stringWithFormat:@"Dear %@.%@",mytitle,mylastname];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

            height=height-;

        }

        if(self.coverletter!=nil&&![self.coverletter isEqualToString:@""]){

            temtext=[NSString stringWithFormat:@"%@",self.coverletter];

            height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

        }

        //结束

        CGContextEndPage(pdfContext);

    }

    if(YES){

    //开始画resume内容

    CGContextBeginPage(pdfContext, &pageRect);

    CGContextSelectFont(pdfContext, "Helvetica", , kCGEncodingMacRoman);

    CGContextSetTextDrawingMode(pdfContext, kCGTextFill);

    CGContextSetRGBFillColor(pdfContext, , , , );

    //显示first和lastname

    if(self.firstname!=nil||self.lastname!=nil){

        if(self.firstname==nil)

            self.firstname=@"";

        if(self.lastname==nil)

            self.lastname=@"";

        temtext=[NSString stringWithFormat:@"%@ %@",self.firstname,self.lastname];

        width=[self getfontwidth:temtext fontsize:];

        height=; 

        text=(char*)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

    }

    //显示street等basicinfo信息

    //street,apt

    if((self.street!=nil &&![self.street isEqualToString:@""])||(self.apt!=nil&&![self.apt isEqualToString:@""])){

        if(self.street==nil){

            self.street=@"";

        }

        if(self.apt==nil){

            self.apt=@"";

        }

        height=[self getfontheight:temtext fontsize: height:height];

        CGContextSelectFont(pdfContext, "Helvetica", , kCGEncodingMacRoman);

        temtext=[NSString stringWithFormat:@"%@,%@",self.street,self.apt];

        width=[self getfontwidth:temtext fontsize:];

        text=(char *)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text,strlen(text));

    }

    //city,state zip

    if((self.city!=nil&&![self.city  isEqualToString:@""])||

       (self.state!=nil&&![self.state isEqualToString:@""])||

       (self.zip!=nil&&![self.state isEqualToString:@""])){

        if(self.city==nil){

            self.city=@"";

        }

        if(self.state==nil){

            self.state=@"";

        }

        if(self.zip==nil){

            self.zip=@"";

        }

        height=[self getfontheight:temtext fontsize: height:height];

        CGContextSelectFont(pdfContext, "Helvetica", ,kCGEncodingMacRoman );

        temtext=[NSString stringWithFormat:@"%@,%@,%@",self.city,self.state,self.zip];

        width=[self getfontwidth:temtext fontsize:];

        text=(char *)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

    }

    //phone

    if(self.phone!=nil&&![self.phone isEqualToString:@""]){

        height=[self getfontheight:temtext fontsize: height:height];

        CGContextSelectFont(pdfContext, "Helvetica", ,kCGEncodingMacRoman );

        temtext=[NSString stringWithFormat:@"Phone: %@",self.phone];

        width=[self getfontwidth:temtext fontsize:];

        text=(char *)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

    }

    //fax

    if(self.fax!=nil&&![self.fax isEqualToString:@""]){

        height=[self getfontheight:temtext fontsize: height:height];

       CGContextSelectFont(pdfContext, "Helvetica", ,kCGEncodingMacRoman );

        temtext=[NSString stringWithFormat:@"Fax: %@",self.fax];

        width=[self getfontwidth:temtext fontsize:];

        text=(char *)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

    }

    //Email

    if(self.Email!=nil&&![self.Email isEqualToString:@""]){

        height=[self getfontheight:temtext fontsize: height:height];

        temtext=[NSString stringWithFormat:@"Email: %@",self.Email];

        width=[self getfontwidth:temtext fontsize:];

        text=(char *)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

    }

    //website

    if(self.website!=nil&&![self.website isEqualToString:@""]){

        height=[self getfontheight:temtext fontsize: height:height];

        temtext=[NSString stringWithFormat:@"Website: %@",self.website];

        width=[self getfontwidth:temtext fontsize:];

        text=(char *)[temtext UTF8String];

        CGContextShowTextAtPoint(pdfContext, (-width)/, height, text, strlen(text));

    }

    //Objective

    if(self.objective!=nil&&![self.objective isEqualToString:@""]){

        //画线

        height=[self getfontheight:temtext fontsize: height:height];

        CGContextMoveToPoint(pdfContext, , height);

        CGContextAddLineToPoint(pdfContext, -, height);

        CGContextStrokePath(pdfContext);

        height=height-;

        text=(char *)[@"Objective" UTF8String];

        CGContextSetFontSize(pdfContext, );

        CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

      //  CGContextSetFontSize(pdfContext, 10);

        height=height+;

        temtext=[NSString stringWithFormat:@"%@",self.objective];

        height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

    }

    //5个可以排序的

    for (int i=;i<;i++){

        if([OrderData getskillnumber]==i){                  //skill

            if(self.skills!=nil&&[self.skills count]!=){

                // skill划线

                height=[self getfontheight:temtext fontsize: height:height];

                CGContextMoveToPoint(pdfContext, , height);

                CGContextAddLineToPoint(pdfContext, -, height);

                CGContextStrokePath(pdfContext);

                height=height-;

                text=(char *)[@"Skills" UTF8String];

                CGContextSetFontSize(pdfContext, );

                CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

                //skill内容

                //height=height+13;

                for(int i=;i<[self.skills count];i++){

                    NSManagedObject *object=[self.skills objectAtIndex:i];

                    temtext=[NSString stringWithFormat:@"* %@",[object valueForKey:@"skill"]];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                  //  height=height-13;

                }

            }

        }else if([OrderData getothernumber]==i){                //other

            if(self.others!=nil&&[self.others count]!=){

                // other划线

                height=[self getfontheight:temtext fontsize: height:height];

                CGContextMoveToPoint(pdfContext, , height);

                CGContextAddLineToPoint(pdfContext, -, height);

                CGContextStrokePath(pdfContext);

                height=height-;

                text=(char *)[@"Others" UTF8String];

                CGContextSetFontSize(pdfContext, );

                CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

                //other内容

                for(int i=;i<[self.others count];i++){

                    NSManagedObject *object=[self.others objectAtIndex:i];

                    temtext=[NSString stringWithFormat:@"* %@",[object valueForKey:@"other"]];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                  //  height=height-13;

                }

            }

        }else if([OrderData getexperiencenumber]==i){                   //experience

            if(self.experience!=nil&&[self.experience count]!=){

                //排序

                NSSortDescriptor *descriptor=[NSSortDescriptor sortDescriptorWithKey:@"start" ascending:NO];

                [self.experience setArray:[self.experience sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]]];

                // other划线

                height=[self getfontheight:temtext fontsize: height:height];

                CGContextMoveToPoint(pdfContext, , height);

                CGContextAddLineToPoint(pdfContext, -, height);

                CGContextStrokePath(pdfContext);

                height=height-;

                text=(char *)[@"Experience" UTF8String];

                CGContextSetFontSize(pdfContext, );

                CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

                //experience内容

                for(int i=;i<[self.experience count];i++){

                    NSManagedObject *object=[self.experience objectAtIndex:i];

                    NSString *position=[object valueForKey:@"position"];

                    NSString *companyname=[object valueForKey:@"companyname"];

                    NSString *location=[object valueForKey:@"location"];

                    NSDate *startdate=[object valueForKey:@"start"];

                    NSDate *enddate=[object valueForKey:@"end"];

                    NSString *thisid=[object valueForKey:@"thisid"];

                    temtext=[NSString stringWithFormat:@"%@",position];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    height=height-;

                    temtext=[NSString stringWithFormat:@"%@, %@",companyname,location];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    height=height-;

                    NSDateFormatter *timeformatter=[[NSDateFormatter alloc]init];

                    [timeformatter setDateFormat:@"MMMM, yyyy"];

                    NSNumber *number=(NSNumber*)[object valueForKey:@"currentjob"];

                    if(!number.boolValue){

                        temtext=[NSString stringWithFormat:@"%@ ~ %@",[timeformatter stringFromDate:startdate],[timeformatter stringFromDate:enddate]];

                    }else{

                         temtext=[NSString stringWithFormat:@"%@ ~ Present",[timeformatter stringFromDate:startdate]];

                    }

                    [timeformatter release];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    NSMutableArray *responsibility=[DataController getresponsibility:thisid];

                    NSLog(@"responsibility cout:%d \n responsibility context:%@",[responsibility count],responsibility);

                    for(int j=;j<[responsibility count];j++){

                        NSManagedObject *object=[responsibility objectAtIndex:j];

                        NSString *respon=[object valueForKey:@"responsibility"];

                        temtext=[NSString stringWithFormat:@"* %@",respon];

                        height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                        height=height-;

                        NSLog(@"J=%d",j);

                    }               

                    height=height-;

                }

            }

        }else if([OrderData geteducationnumber]==i){                    //Education

            if(self.education!=nil&&[self.education count]!=){

                //排序

                NSSortDescriptor *descriptor=[NSSortDescriptor sortDescriptorWithKey:@"starttime" ascending:NO];

                [self.education setArray:[self.education sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]]];

                // other划线

                height=[self getfontheight:temtext fontsize: height:height];

                CGContextMoveToPoint(pdfContext, , height);

                CGContextAddLineToPoint(pdfContext, -, height);

                CGContextStrokePath(pdfContext);

                height=height-;

                text=(char *)[@"Education" UTF8String];

                CGContextSetFontSize(pdfContext, );

                CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

                //内容

                for(int i=;i<[self.education count];i++){

                    NSManagedObject *object=[self.education objectAtIndex:i];

                    NSString *schoolname=[object valueForKey:@"school"];

                    NSDate *startdate=[object valueForKey:@"starttime"];

                    NSDate *enddate=[object valueForKey:@"endtime"];

                    NSString *comment=[object valueForKey:@"comment"];

                    NSString *major=[object valueForKey:@"major"];

                    //height=height-13;

                    temtext=[NSString stringWithFormat:@"%@",schoolname];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];    

                    height=height-;

                    NSDateFormatter *timeformatter=[[NSDateFormatter alloc]init];

                    [timeformatter setDateFormat:@"MMMM, yyyy"];

                    temtext=[NSString stringWithFormat:@"%@ ~ %@",[timeformatter stringFromDate:startdate],[timeformatter stringFromDate:enddate]];

                    [timeformatter release];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    height=height-;

                    temtext=[NSString stringWithFormat:@"%@",major];

                    height=[self    plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    height=height-;

                    temtext=[NSString stringWithFormat:@"%@",comment];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                }

            }

        }else if([OrderData getawardnumber]==i){            //award

            if(self.awards!=nil&&[self.awards count]!=){

                //排序

                NSSortDescriptor *descriptor=[NSSortDescriptor sortDescriptorWithKey:@"awarddate" ascending:NO];

                [self.awards setArray:[self.awards sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]]];

                // other划线

                height=[self getfontheight:temtext fontsize: height:height];

                CGContextMoveToPoint(pdfContext, , height);

                CGContextAddLineToPoint(pdfContext, -, height);

                CGContextStrokePath(pdfContext);

                height=height-;

                text=(char *)[@"Awards" UTF8String];

                CGContextSetFontSize(pdfContext, );

                CGContextShowTextAtPoint(pdfContext, , height, text, strlen(text));

                //award内容

                for(int i=;i<[self.awards count];i++){

                    NSManagedObject *object=[self.awards objectAtIndex:i];

                    NSString *comment=[object valueForKey:@"comment"];

                    NSString *name=[object valueForKey:@"name"];

                    NSDate *awarddate=[object valueForKey:@"awarddate"];

                    temtext=[NSString stringWithFormat:@"%@",name];

                   height= [self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    height=height-;

                    NSDateFormatter *timeformatter=[[NSDateFormatter alloc]init];

                    [timeformatter setDateFormat:@"MMMM, dd, yyyy"];

                    temtext=[NSString stringWithFormat:@"%@",[timeformatter stringFromDate:awarddate]];

                    [timeformatter release];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                   height=height-;

                    temtext=[NSString stringWithFormat:@"%@",comment];

                    height=[self plaintextatwith: width: text:temtext height:height fontsize: context:pdfContext];

                    height=height-;

                    }

                }

            }

        } 

               CGContextEndPage(pdfContext);

    }

        CGContextRelease(pdfContext);

}

ios 创建和绘画pdf文件 -转的更多相关文章

  1. PDFBox创建并打印PDF文件, 以及缩放问题的处理.

    PDFBox带了一些很方便的API, 可以直接创建 读取 编辑 打印PDF文件. 创建PDF文件 public static byte[] createHelloPDF() { ByteArrayOu ...

  2. ios创建bundle的图片资源文件(转)

    在ios开发中为了方便管理资源文件,可以使用bundle的方式来进行管理,比如kkgridview里就是把所需的图片文件全部放在一个bundle来管理的 . 切记目前iOS中只允许使用bundle管理 ...

  3. ios创建的sqlite数据库文件如何从ios模拟器中导出

    为了验证数据库的结构,有的时候需要使用一些管理工具来直接查看sqlite数据库的内容,在windows下有sqlite3的专用工具下载,而在ios下也可以使用火狐浏览器的插件sqlitemanager ...

  4. ios 创建自己的.a文件

    1:首先创建个 静态工程(Cocoa Touch Static Library); 方法名字,一定要暴露在.h文件中, 2:分别在模拟器环境和真机环境下 Analyze (shift+command+ ...

  5. iOS开发:读取pdf文件

    方法一:使用QLPreviewController #pragma mark  浏览存在沙盒的文件 -(void)quickLook { QLPreviewController *QLPreviewV ...

  6. 怎么用OCR图文识别软件在MS Office中创建PDF文件

    ABBYY PDF Transformer+是一款可创建.编辑及将PDF文件转换为其他可编辑格式的OCR图文识别软件,不仅可以从纸质文档.图像文件和任何其他流行格式创建PDF文件(相关文章请参考如何从 ...

  7. PDF文件的加载及展示

    项目需要显示PDF文件,于是遍寻了网络,发现的方法以下几种: 1.使用UIWebView加载,没啥说的,根据文件路径,网络或者本地皆可,创建一个NSURLRequest,然后用webView加载就可以 ...

  8. 使用iTextSharp修改PDF文件(一)

    这个iTextSharp确实是个好东西,可以创建.读取PDF格式的文档,虽然我的需求比较简单,但我首先还是基本上.完整地看完了它的相关文档,不喜欢英文的同志,可以搜索一篇<用C#制作PDF文件全 ...

  9. 使用pdfFactory为PDF文件设定查看选项

    一般情况下,大部分PDF文件都会按照默认的查看设置,以100%的尺寸显示第一页的内容.但在一些特殊情况下,PDF文件的创建者会设定其他的文件查看尺寸,或设定打开页为第N页,来达到引起阅读者关注的目的. ...

随机推荐

  1. PDO防止SQL注入具体介绍

    <span style="font-size:18px;"><?php $dbh = new PDO("mysql:host=localhost; db ...

  2. 微信小程序实战之 pay(支付页面)

    项目目录: 逻辑层: pay.js // pages/pay/pay.js Page({ /** * 页面的初始数据 */ data: { resultType: "", resu ...

  3. ./configure && make && make install详解 (转)

    在Linux中利用源码包安装软件最重要的就是要仔细阅读安装包当中的README INSTALL两个说明文件,这两个文件会清楚的告诉你如何可以正确的完成这个软件的安装! 我们都知道源码包安装分为这么几个 ...

  4. How to get service execuable path

    Some time we need to get specific service path and then do something you want. there are 2 way to ge ...

  5. css3最新版中文参考手册在线浏览

    对于CSS 3.0,它对于我们Web设计人员来说不只是新奇的技术,更重要的是这些全新概念的Web应用给我们的设计开发提高了效率以及更多的无限可能性,我们将不必再依赖图片或者 Javascript 去完 ...

  6. 【iOS系列】-文件管理

    OC中操作文件,需要使用NSFileManager: 需要使用NSFileManager的创建方式: //单例模式创建对象 NSFileManager * f2 = [NSFileManager de ...

  7. 2016/3/24 ①数据库与php连接 三种输出fetch_row()、fetch_all()、fetch_assoc() ②增删改时判断(布尔型) ③表与表之间的联动 ④下拉菜单 ⑤登陆 三个页面

    ①数据库与php连接   图表 header("content-type:text/html;charset=utf-8"); //第一种方式: //1,生成连接,连接到数据库上的 ...

  8. <label>标签for属性

    label 元素不会向用户呈现任何特殊效果.不过,它为鼠标用户改进了可用性.如果您在 label 元素内点击文本,就会触发此控件.就是说,当用户选择该标签时,浏览器就会自动将焦点转到和标签相关的表单控 ...

  9. ABAP JSON

    1 DATA: lv_em TYPE string, lv_em1 TYPE string. DATA: lt_but021 TYPE TABLE OF but021, lt_but0211 TYPE ...

  10. html5--switch选择结构的优化

    html5--switch选择结构的优化 问题: 使用循环语句判断月份是31天还是30天 两点提示: 使用switch多条件判断语句 合理的省略break优化代码 <!DOCTYPE html& ...